From 6cc974a8e9acacb0568974648325497278463d26 Mon Sep 17 00:00:00 2001 From: "Veronica K. B. Olsen" <1619840+vkbo@users.noreply.github.com> Date: Thu, 18 Feb 2021 20:47:22 +0100 Subject: [PATCH] Fix tests --- sample/nwProject.nwx | 14 +++++++------- tests/conftest.py | 2 ++ .../reference/coreProject_NewCustomA_nwProject.nwx | 2 +- .../reference/coreProject_NewCustomB_nwProject.nwx | 2 +- tests/reference/coreProject_NewFile_nwProject.nwx | 2 +- .../reference/coreProject_NewMinimal_nwProject.nwx | 2 +- tests/reference/coreProject_NewRoot_nwProject.nwx | 2 +- tests/reference/guiEditor_Main_Final_nwProject.nwx | 2 +- .../reference/guiEditor_Main_Initial_nwProject.nwx | 2 +- tests/reference/guiItemEditor_Dialog_nwProject.nwx | 2 +- .../reference/guiProjSettings_Dialog_nwProject.nwx | 2 +- tests/test_base/test_base_config.py | 2 +- tests/test_core/test_core_tokenizer.py | 6 ++++-- 13 files changed, 23 insertions(+), 19 deletions(-) diff --git a/sample/nwProject.nwx b/sample/nwProject.nwx index 5f4ff79c..c4351b24 100644 --- a/sample/nwProject.nwx +++ b/sample/nwProject.nwx @@ -1,17 +1,17 @@ - + Sample Project Sample Project Jane Smith Jay Doh - 1022 - 161 - 48346 + 1054 + 166 + 49435 False - None + en True None True @@ -27,7 +27,7 @@ %title% - Chapter %ch%: %title% + Chapter %chw%: %title% %title% Scene %ch%.%sc%: %title%
@@ -121,7 +121,7 @@ 1810 318 8 - 1112 + 1505 Another Scene diff --git a/tests/conftest.py b/tests/conftest.py index d7001c1d..36bf44d3 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -118,6 +118,7 @@ def tmpConf(tmpDir): theConf = Config() theConf.initConfig(tmpDir, tmpDir) theConf.setLastPath("") + theConf.guiLang = "en_GB" return theConf @pytest.fixture(scope="function") @@ -130,6 +131,7 @@ def fncConf(fncDir): theConf = Config() theConf.initConfig(fncDir, fncDir) theConf.setLastPath("") + theConf.guiLang = "en_GB" return theConf @pytest.fixture(scope="function") diff --git a/tests/reference/coreProject_NewCustomA_nwProject.nwx b/tests/reference/coreProject_NewCustomA_nwProject.nwx index 7673815d..53695bd8 100644 --- a/tests/reference/coreProject_NewCustomA_nwProject.nwx +++ b/tests/reference/coreProject_NewCustomA_nwProject.nwx @@ -11,7 +11,7 @@ True - None + en_GB False None True diff --git a/tests/reference/coreProject_NewCustomB_nwProject.nwx b/tests/reference/coreProject_NewCustomB_nwProject.nwx index baaf3298..656001e4 100644 --- a/tests/reference/coreProject_NewCustomB_nwProject.nwx +++ b/tests/reference/coreProject_NewCustomB_nwProject.nwx @@ -11,7 +11,7 @@ True - None + en_GB False None True diff --git a/tests/reference/coreProject_NewFile_nwProject.nwx b/tests/reference/coreProject_NewFile_nwProject.nwx index 83d80233..57f3b0ed 100644 --- a/tests/reference/coreProject_NewFile_nwProject.nwx +++ b/tests/reference/coreProject_NewFile_nwProject.nwx @@ -9,7 +9,7 @@ True - None + en_GB False None True diff --git a/tests/reference/coreProject_NewMinimal_nwProject.nwx b/tests/reference/coreProject_NewMinimal_nwProject.nwx index ba867df1..122efc00 100644 --- a/tests/reference/coreProject_NewMinimal_nwProject.nwx +++ b/tests/reference/coreProject_NewMinimal_nwProject.nwx @@ -9,7 +9,7 @@ True - None + en_GB False None True diff --git a/tests/reference/coreProject_NewRoot_nwProject.nwx b/tests/reference/coreProject_NewRoot_nwProject.nwx index d437d4e2..8a6ae326 100644 --- a/tests/reference/coreProject_NewRoot_nwProject.nwx +++ b/tests/reference/coreProject_NewRoot_nwProject.nwx @@ -9,7 +9,7 @@ True - None + en_GB False None True diff --git a/tests/reference/guiEditor_Main_Final_nwProject.nwx b/tests/reference/guiEditor_Main_Final_nwProject.nwx index 6e511bca..1cd4a051 100644 --- a/tests/reference/guiEditor_Main_Final_nwProject.nwx +++ b/tests/reference/guiEditor_Main_Final_nwProject.nwx @@ -9,7 +9,7 @@ True - None + en_GB True None True diff --git a/tests/reference/guiEditor_Main_Initial_nwProject.nwx b/tests/reference/guiEditor_Main_Initial_nwProject.nwx index 96af56bb..561fd147 100644 --- a/tests/reference/guiEditor_Main_Initial_nwProject.nwx +++ b/tests/reference/guiEditor_Main_Initial_nwProject.nwx @@ -9,7 +9,7 @@ True - None + en_GB False None True diff --git a/tests/reference/guiItemEditor_Dialog_nwProject.nwx b/tests/reference/guiItemEditor_Dialog_nwProject.nwx index 89beddc9..3f581fad 100644 --- a/tests/reference/guiItemEditor_Dialog_nwProject.nwx +++ b/tests/reference/guiItemEditor_Dialog_nwProject.nwx @@ -9,7 +9,7 @@ True - None + en_GB False None True diff --git a/tests/reference/guiProjSettings_Dialog_nwProject.nwx b/tests/reference/guiProjSettings_Dialog_nwProject.nwx index a935bee7..4e8674fe 100644 --- a/tests/reference/guiProjSettings_Dialog_nwProject.nwx +++ b/tests/reference/guiProjSettings_Dialog_nwProject.nwx @@ -11,7 +11,7 @@ True - None + en_GB False en True diff --git a/tests/test_base/test_base_config.py b/tests/test_base/test_base_config.py index 9a0a561b..c755b6a0 100644 --- a/tests/test_base/test_base_config.py +++ b/tests/test_base/test_base_config.py @@ -197,7 +197,7 @@ def testBaseConfig_Init(monkeypatch, tmpDir, fncDir, outDir, refDir, filesDir): tstApp = DummyApp() tstConf.initLocalisation(tstApp) - theList = tstConf.listLanguages() + theList = tstConf.listLanguages(tstConf.LANG_NW) assert theList == [("en_GB", "British English")] copyfile(confFile, testFile) diff --git a/tests/test_core/test_core_tokenizer.py b/tests/test_core/test_core_tokenizer.py index 07dc5241..4062f710 100644 --- a/tests/test_core/test_core_tokenizer.py +++ b/tests/test_core/test_core_tokenizer.py @@ -117,7 +117,8 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, dummyGUI): """ theProject = NWProject(dummyGUI) theProject.projTree.setSeed(42) - theProject.loadProjectLocalisation("en") + theProject.projLang = "en" + theProject._loadProjectLocalisation() theToken = Tokenizer(theProject, dummyGUI) theToken.setKeepMarkdown(True) @@ -414,7 +415,8 @@ def testCoreToken_Headers(dummyGUI): """Test the header and page parser of the Tokenizer class. """ theProject = NWProject(dummyGUI) - theProject.loadProjectLocalisation("en") + theProject.projLang = "en" + theProject._loadProjectLocalisation() theToken = Tokenizer(theProject, dummyGUI) # Nothing