Fixed test
This commit is contained in:
+4
-1
@@ -317,7 +317,10 @@ class Config:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def setLastPath(self, lastPath):
|
def setLastPath(self, lastPath):
|
||||||
self.lastPath = path.dirname(lastPath)
|
if lastPath is None or lastPath == "":
|
||||||
|
self.lastPath = ""
|
||||||
|
else:
|
||||||
|
self.lastPath = path.dirname(lastPath)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def setWinSize(self, newWidth, newHeight):
|
def setWinSize(self, newWidth, newHeight):
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ backuponclose = False
|
|||||||
askbeforebackup = True
|
askbeforebackup = True
|
||||||
|
|
||||||
[Path]
|
[Path]
|
||||||
|
lastpath =
|
||||||
recent0 =
|
recent0 =
|
||||||
recent1 =
|
recent1 =
|
||||||
recent2 =
|
recent2 =
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ def testConfigInit(nwTemp,nwRef):
|
|||||||
tmpConf = path.join(nwTemp,"novelwriter.conf")
|
tmpConf = path.join(nwTemp,"novelwriter.conf")
|
||||||
refConf = path.join(nwRef, "novelwriter.conf")
|
refConf = path.join(nwRef, "novelwriter.conf")
|
||||||
assert theConf.initConfig(nwTemp)
|
assert theConf.initConfig(nwTemp)
|
||||||
|
assert theConf.setLastPath("")
|
||||||
|
assert theConf.saveConfig()
|
||||||
assert cmpFiles(tmpConf, refConf, [2])
|
assert cmpFiles(tmpConf, refConf, [2])
|
||||||
assert not theConf.confChanged
|
assert not theConf.confChanged
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user