Update tests
This commit is contained in:
@@ -308,7 +308,7 @@ def testCoreTools_NewCustomA(monkeypatch, fncPath, tstPaths, mockGUI, mockRnd):
|
||||
projData = {
|
||||
"projName": "Test Custom",
|
||||
"projTitle": "Test Novel",
|
||||
"projAuthors": "Jane Doe\nJohn Doh\n",
|
||||
"projAuthor": "Jane Doe",
|
||||
"projPath": fncPath,
|
||||
"popSample": False,
|
||||
"popMinimal": False,
|
||||
@@ -346,7 +346,7 @@ def testCoreTools_NewCustomB(monkeypatch, fncPath, tstPaths, mockGUI, mockRnd):
|
||||
projData = {
|
||||
"projName": "Test Custom",
|
||||
"projTitle": "Test Novel",
|
||||
"projAuthors": "Jane Doe\nJohn Doh\n",
|
||||
"projAuthor": "Jane Doe",
|
||||
"projPath": fncPath,
|
||||
"popSample": False,
|
||||
"popMinimal": False,
|
||||
@@ -378,7 +378,7 @@ def testCoreTools_NewSample(monkeypatch, fncPath, tmpConf, tmpPath, mockGUI):
|
||||
projData = {
|
||||
"projName": "Test Sample",
|
||||
"projTitle": "Test Novel",
|
||||
"projAuthors": "Jane Doe\nJohn Doh\n",
|
||||
"projAuthor": "Jane Doe",
|
||||
"projPath": fncPath,
|
||||
"popSample": True,
|
||||
"popMinimal": False,
|
||||
|
||||
@@ -480,25 +480,9 @@ def testCoreProject_Methods(monkeypatch, mockGUI, fncPath, mockRnd):
|
||||
theProject.data.setTitle(" A Title ")
|
||||
assert theProject.data.title == "A Title"
|
||||
|
||||
# Project Authors
|
||||
# Check that the list is cleaned up and that it can be extracted as
|
||||
# a properly formatted string, depending on number of names
|
||||
theProject.data.setAuthors([])
|
||||
assert theProject.data.authors == []
|
||||
theProject.data.setAuthors(" Jane Doe \n John Doh \n ")
|
||||
assert theProject.data.authors == ["Jane Doe", "John Doh"]
|
||||
|
||||
theProject.data.setAuthors("")
|
||||
assert theProject.getFormattedAuthors() == ""
|
||||
|
||||
theProject.data.setAuthors("Jane Doe")
|
||||
assert theProject.getFormattedAuthors() == "Jane Doe"
|
||||
|
||||
theProject.data.setAuthors("Jane Doe\nJohn Doh")
|
||||
assert theProject.getFormattedAuthors() == "Jane Doe and John Doh"
|
||||
|
||||
theProject.data.setAuthors("Jane Doe\nJohn Doh\nBod Owens")
|
||||
assert theProject.getFormattedAuthors() == "Jane Doe, John Doh and Bod Owens"
|
||||
# Project Author
|
||||
theProject.data.setAuthor(" Jane\tDoe ")
|
||||
assert theProject.data.author == "Jane Doe"
|
||||
|
||||
# Edit Time
|
||||
theProject.data.setEditTime(1234)
|
||||
|
||||
@@ -143,7 +143,7 @@ def testCoreProjectXML_ReadCurrent(monkeypatch, tstPaths, fncPath):
|
||||
# Check loaded data
|
||||
assert data.name == "Sample Project"
|
||||
assert data.title == "Sample Project"
|
||||
assert data.authors == ["Jane Smith", "Jay Doh"]
|
||||
assert data.author == "Jane Smith"
|
||||
assert data.saveCount == 5
|
||||
assert data.autoCount == 10
|
||||
assert data.editTime == 1000
|
||||
@@ -269,7 +269,7 @@ def testCoreProjectXML_ReadLegacy10(tstPaths, fncPath, mockRnd):
|
||||
# Check loaded data
|
||||
assert data.name == "Sample Project"
|
||||
assert data.title == "Sample Project"
|
||||
assert data.authors == ["Jane Smith", "Jay Doh"]
|
||||
assert data.author == "Jay Doh" # Only last author is preserved
|
||||
assert data.saveCount == 0 # Doesn't exist in 1.0
|
||||
assert data.autoCount == 0 # Doesn't exist in 1.0
|
||||
assert data.editTime == 0 # Doesn't exist in 1.0
|
||||
@@ -411,7 +411,7 @@ def testCoreProjectXML_ReadLegacy11(tstPaths, fncPath, mockRnd):
|
||||
# Check loaded data
|
||||
assert data.name == "Sample Project"
|
||||
assert data.title == "Sample Project"
|
||||
assert data.authors == ["Jane Smith", "Jay Doh"]
|
||||
assert data.author == "Jay Doh" # Only last author is preserved
|
||||
assert data.saveCount == 5
|
||||
assert data.autoCount == 10
|
||||
assert data.editTime == 1000
|
||||
@@ -553,7 +553,7 @@ def testCoreProjectXML_ReadLegacy12(tstPaths, fncPath, mockRnd):
|
||||
# Check loaded data
|
||||
assert data.name == "Sample Project"
|
||||
assert data.title == "Sample Project"
|
||||
assert data.authors == ["Jane Smith", "Jay Doh"]
|
||||
assert data.author == "Jay Doh" # Only last author is preserved
|
||||
assert data.saveCount == 5
|
||||
assert data.autoCount == 10
|
||||
assert data.editTime == 1000
|
||||
@@ -698,7 +698,7 @@ def testCoreProjectXML_ReadLegacy13(tstPaths, fncPath, mockRnd):
|
||||
# Check loaded data
|
||||
assert data.name == "Sample Project"
|
||||
assert data.title == "Sample Project"
|
||||
assert data.authors == ["Jane Smith", "Jay Doh"]
|
||||
assert data.author == "Jay Doh" # Only last author is preserved
|
||||
assert data.saveCount == 5
|
||||
assert data.autoCount == 10
|
||||
assert data.editTime == 1000
|
||||
@@ -843,7 +843,7 @@ def testCoreProjectXML_ReadLegacy14(tstPaths, fncPath, mockRnd):
|
||||
# Check loaded data
|
||||
assert data.name == "Sample Project"
|
||||
assert data.title == "Sample Project"
|
||||
assert data.authors == ["Jane Smith", "Jay Doh"]
|
||||
assert data.author == "Jay Doh" # Only last author is preserved
|
||||
assert data.saveCount == 5
|
||||
assert data.autoCount == 10
|
||||
assert data.editTime == 1000
|
||||
|
||||
Reference in New Issue
Block a user