Drop the XML backup file

This commit is contained in:
Veronica Berglyd Olsen
2024-01-16 16:14:10 +01:00
parent ae7c19f923
commit 97ea3ebc16
5 changed files with 11 additions and 53 deletions
-11
View File
@@ -57,7 +57,6 @@ def testCoreProjectXML_ReadCurrent(monkeypatch, tstPaths, fncPath):
refFile = tstPaths.filesDir / "nwProject-1.5.nwx"
tstFile = tstPaths.outDir / "ProjectXML_ReadCurrent.nwx"
xmlFile = fncPath / "nwProject-1.5.nwx"
bakFile = fncPath / "nwProject-1.5.bak"
outFile = fncPath / "nwProject.nwx"
xmlReader = ProjectXMLReader(xmlFile)
@@ -71,16 +70,6 @@ def testCoreProjectXML_ReadCurrent(monkeypatch, tstPaths, fncPath):
assert xmlReader.read(data, content) is False
assert xmlReader.state == XMLReadState.CANNOT_PARSE
# Also add an invalid backup file
writeFile(bakFile, "")
assert xmlReader.read(data, content) is False
assert xmlReader.state == XMLReadState.CANNOT_PARSE
# Add a valid backup file, that is not novelWriter
writeFile(bakFile, "<xml/>")
assert xmlReader.read(data, content) is False
assert xmlReader.state == XMLReadState.NOT_NWX_FILE
# Add a valid project file, that is not novelWriter
writeFile(xmlFile, "<xml/>")
assert xmlReader.read(data, content) is False