More tests for class Config
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user