Complete loading project xml via data class

This commit is contained in:
Veronica Berglyd Olsen
2022-10-31 18:11:46 +01:00
parent 522acc479b
commit 3a161e90f9
14 changed files with 129 additions and 161 deletions
+11 -11
View File
@@ -941,19 +941,19 @@ def testCoreProject_Methods(monkeypatch, mockGUI, tmpDir, fncDir, mockRnd):
# Spell check
theProject.setProjectChanged(False)
assert theProject.setSpellCheck(True)
assert not theProject.setSpellCheck(False)
theProject.data.setSpellCheck(True)
theProject.data.setSpellCheck(False)
assert theProject.projChanged
# Spell language
theProject.setProjectChanged(False)
assert theProject.projSpell is None
assert theProject.setSpellLang(None) is False
assert theProject.projSpell is None
assert theProject.setSpellLang("None") is False # Should be interpreded as None
assert theProject.projSpell is None
assert theProject.setSpellLang("en_GB")
assert theProject.projSpell == "en_GB"
assert theProject.data.spellLang is None
theProject.data.setSpellLang(None)
assert theProject.data.spellLang is None
theProject.data.setSpellLang("None") # Should be interpreded as None
assert theProject.data.spellLang is None
theProject.data.setSpellLang("en_GB")
assert theProject.data.spellLang == "en_GB"
assert theProject.projChanged
# Project Language
@@ -982,8 +982,8 @@ def testCoreProject_Methods(monkeypatch, mockGUI, tmpDir, fncDir, mockRnd):
# Autoreplace
theProject.setProjectChanged(False)
assert theProject.setAutoReplace({"A": "B", "C": "D"})
assert theProject.autoReplace == {"A": "B", "C": "D"}
theProject.data.setAutoReplace({"A": "B", "C": "D"})
assert theProject.data.autoReplace == {"A": "B", "C": "D"}
assert theProject.projChanged
# Change project tree order
+1 -1
View File
@@ -160,7 +160,7 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, mockGUI):
nDoc = NWDoc(theProject, sHandle)
assert nDoc.writeDocument(docText)
theProject.setAutoReplace({"A": "this", "B": "that"})
theProject.data.setAutoReplace({"A": "this", "B": "that"})
assert theProject.saveProject()