Tighten up the item class (#937)

* Protect the attributes of the NWItem class
* Fix test coverage
* Add a type checker function to the tree class
This commit is contained in:
Veronica Berglyd Olsen authored and GitHub committed 2021-12-31 16:25:20 +01:00
1 parent af3d0d2eb0
commit 6ac9e1aec4
14 files changed
+255 -183

No files matched your search

+2 -2
View File
@@ -62,9 +62,9 @@ def testDlgItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncProj):
assert nwGUI.editItem() is False
# Invalid Type
nwGUI.theProject.projTree["0e17daca5f3e1"].itemType = nwItemType.NO_TYPE
nwGUI.theProject.projTree["0e17daca5f3e1"]._type = nwItemType.NO_TYPE
assert nwGUI.editItem() is False
nwGUI.theProject.projTree["0e17daca5f3e1"].itemType = nwItemType.FILE
nwGUI.theProject.projTree["0e17daca5f3e1"]._type = nwItemType.FILE
# Open Properly
assert nwGUI.editItem() is True