More tests for class Config

This commit is contained in:
Veronica K. B. Olsen
2019-05-16 20:27:56 +02:00
parent 89f118d62d
commit 63c3182a0e
2 changed files with 55 additions and 8 deletions
+40
View File
@@ -23,7 +23,47 @@ if path.isfile(tmpConf):
def testConfigInit():
assert theConf.initConfig(testTemp)
assert cmpFiles(tmpConf, refConf, [2])
assert not theConf.confChanged
def testConfigSave():
assert theConf.saveConfig()
assert cmpFiles(tmpConf, refConf, [2])
assert not theConf.confChanged
def testConfigSetConfPath():
assert theConf.setConfPath(None)
assert not theConf.setConfPath(path.join("somewhere","over","the","rainbow"))
assert theConf.setConfPath(path.join(testTemp,"novelwriter.conf"))
assert theConf.confPath == testTemp
assert theConf.confFile == "novelwriter.conf"
assert not theConf.confChanged
def testConfigLoad():
assert theConf.loadConfig()
assert not theConf.confChanged
def testConfigSetWinSize():
assert theConf.setWinSize(1105, 655)
assert not theConf.confChanged
assert theConf.setWinSize(70,70)
assert theConf.confChanged
assert theConf.setWinSize(1100, 650)
assert theConf.saveConfig()
assert cmpFiles(tmpConf, refConf, [2])
assert not theConf.confChanged
def testConfigSetTreeColWidths():
assert theConf.setTreeColWidths([0, 0, 0])
assert theConf.confChanged
assert theConf.setTreeColWidths([120, 30, 50])
assert theConf.saveConfig()
assert cmpFiles(tmpConf, refConf, [2])
assert not theConf.confChanged
def testConfigSetMainPanePos():
assert theConf.setMainPanePos([0, 0])
assert theConf.confChanged
assert theConf.setMainPanePos([300, 800])
assert theConf.saveConfig()
assert cmpFiles(tmpConf, refConf, [2])
assert not theConf.confChanged