Fix tests

This commit is contained in:
Veronica K. B. Olsen
2021-02-18 20:47:22 +01:00
parent 5f3822ac1a
commit 6cc974a8e9
13 changed files with 23 additions and 19 deletions
+7 -7
View File
@@ -1,17 +1,17 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="1.3a0" hexVersion="0x010300a0" fileVersion="1.2" timeStamp="2021-02-18 12:55:23"> <novelWriterXML appVersion="1.3a0" hexVersion="0x010300a0" fileVersion="1.2" timeStamp="2021-02-18 20:34:04">
<project> <project>
<name>Sample Project</name> <name>Sample Project</name>
<title>Sample Project</title> <title>Sample Project</title>
<author>Jane Smith</author> <author>Jane Smith</author>
<author>Jay Doh</author> <author>Jay Doh</author>
<saveCount>1022</saveCount> <saveCount>1054</saveCount>
<autoCount>161</autoCount> <autoCount>166</autoCount>
<editTime>48346</editTime> <editTime>49435</editTime>
</project> </project>
<settings> <settings>
<doBackup>False</doBackup> <doBackup>False</doBackup>
<language>None</language> <language>en</language>
<spellCheck>True</spellCheck> <spellCheck>True</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -27,7 +27,7 @@
</autoReplace> </autoReplace>
<titleFormat> <titleFormat>
<title>%title%</title> <title>%title%</title>
<chapter>Chapter %ch%: %title%</chapter> <chapter>Chapter %chw%: %title%</chapter>
<unnumbered>%title%</unnumbered> <unnumbered>%title%</unnumbered>
<scene>Scene %ch%.%sc%: %title%</scene> <scene>Scene %ch%.%sc%: %title%</scene>
<section></section> <section></section>
@@ -121,7 +121,7 @@
<charCount>1810</charCount> <charCount>1810</charCount>
<wordCount>318</wordCount> <wordCount>318</wordCount>
<paraCount>8</paraCount> <paraCount>8</paraCount>
<cursorPos>1112</cursorPos> <cursorPos>1505</cursorPos>
</item> </item>
<item handle="bc0cbd2a407f3" order="2" parent="e7ded148d6e4a"> <item handle="bc0cbd2a407f3" order="2" parent="e7ded148d6e4a">
<name>Another Scene</name> <name>Another Scene</name>
+2
View File
@@ -118,6 +118,7 @@ def tmpConf(tmpDir):
theConf = Config() theConf = Config()
theConf.initConfig(tmpDir, tmpDir) theConf.initConfig(tmpDir, tmpDir)
theConf.setLastPath("") theConf.setLastPath("")
theConf.guiLang = "en_GB"
return theConf return theConf
@pytest.fixture(scope="function") @pytest.fixture(scope="function")
@@ -130,6 +131,7 @@ def fncConf(fncDir):
theConf = Config() theConf = Config()
theConf.initConfig(fncDir, fncDir) theConf.initConfig(fncDir, fncDir)
theConf.setLastPath("") theConf.setLastPath("")
theConf.guiLang = "en_GB"
return theConf return theConf
@pytest.fixture(scope="function") @pytest.fixture(scope="function")
@@ -11,7 +11,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -11,7 +11,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -9,7 +9,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -9,7 +9,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -9,7 +9,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -9,7 +9,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>True</spellCheck> <spellCheck>True</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -9,7 +9,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -9,7 +9,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>None</spellLang> <spellLang>None</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
@@ -11,7 +11,7 @@
</project> </project>
<settings> <settings>
<doBackup>True</doBackup> <doBackup>True</doBackup>
<language>None</language> <language>en_GB</language>
<spellCheck>False</spellCheck> <spellCheck>False</spellCheck>
<spellLang>en</spellLang> <spellLang>en</spellLang>
<autoOutline>True</autoOutline> <autoOutline>True</autoOutline>
+1 -1
View File
@@ -197,7 +197,7 @@ def testBaseConfig_Init(monkeypatch, tmpDir, fncDir, outDir, refDir, filesDir):
tstApp = DummyApp() tstApp = DummyApp()
tstConf.initLocalisation(tstApp) tstConf.initLocalisation(tstApp)
theList = tstConf.listLanguages() theList = tstConf.listLanguages(tstConf.LANG_NW)
assert theList == [("en_GB", "British English")] assert theList == [("en_GB", "British English")]
copyfile(confFile, testFile) copyfile(confFile, testFile)
+4 -2
View File
@@ -117,7 +117,8 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, dummyGUI):
""" """
theProject = NWProject(dummyGUI) theProject = NWProject(dummyGUI)
theProject.projTree.setSeed(42) theProject.projTree.setSeed(42)
theProject.loadProjectLocalisation("en") theProject.projLang = "en"
theProject._loadProjectLocalisation()
theToken = Tokenizer(theProject, dummyGUI) theToken = Tokenizer(theProject, dummyGUI)
theToken.setKeepMarkdown(True) theToken.setKeepMarkdown(True)
@@ -414,7 +415,8 @@ def testCoreToken_Headers(dummyGUI):
"""Test the header and page parser of the Tokenizer class. """Test the header and page parser of the Tokenizer class.
""" """
theProject = NWProject(dummyGUI) theProject = NWProject(dummyGUI)
theProject.loadProjectLocalisation("en") theProject.projLang = "en"
theProject._loadProjectLocalisation()
theToken = Tokenizer(theProject, dummyGUI) theToken = Tokenizer(theProject, dummyGUI)
# Nothing # Nothing