Fix bug in status label import
This commit is contained in:
@@ -570,6 +570,7 @@ class _StatusPage(NFixedPage):
|
|||||||
for row in csv.reader(fo):
|
for row in csv.reader(fo):
|
||||||
if entry := self._store.fromRaw(row):
|
if entry := self._store.fromRaw(row):
|
||||||
self._addItem(None, entry)
|
self._addItem(None, entry)
|
||||||
|
self._changed = True
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
SHARED.error("Could not read file.", exc=exc)
|
SHARED.error("Could not read file.", exc=exc)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -362,6 +362,7 @@ def testDlgProjSettings_StatusImportExport(qtbot, monkeypatch, nwGUI, projPath,
|
|||||||
status._importLabels()
|
status._importLabels()
|
||||||
|
|
||||||
assert status.listBox.topLevelItemCount() == 4
|
assert status.listBox.topLevelItemCount() == 4
|
||||||
|
assert status.changed is False
|
||||||
|
|
||||||
# Import File
|
# Import File
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
@@ -369,6 +370,7 @@ def testDlgProjSettings_StatusImportExport(qtbot, monkeypatch, nwGUI, projPath,
|
|||||||
status._importLabels()
|
status._importLabels()
|
||||||
|
|
||||||
assert status.listBox.topLevelItemCount() == 8
|
assert status.listBox.topLevelItemCount() == 8
|
||||||
|
assert status.changed is True
|
||||||
|
|
||||||
item4 = status.listBox.topLevelItem(4)
|
item4 = status.listBox.topLevelItem(4)
|
||||||
assert item4 is not None
|
assert item4 is not None
|
||||||
|
|||||||
Reference in New Issue
Block a user