diff --git a/nw/core/index.py b/nw/core/index.py index 16b5f1b8..9565325e 100644 --- a/nw/core/index.py +++ b/nw/core/index.py @@ -269,7 +269,7 @@ class NWIndex(): logger.debug("Indexing item with handle %s" % tHandle) # Check file type, and reset its old index - # Also add a dummy entry T000000 in case the file has no title + # Also add a default entry T000000 in case the file has no title self._refIndex[tHandle] = {} self._refIndex[tHandle]["T000000"] = { "tags" : [], diff --git a/nw/core/spellcheck.py b/nw/core/spellcheck.py index 0595db47..6ea8bb92 100644 --- a/nw/core/spellcheck.py +++ b/nw/core/spellcheck.py @@ -47,17 +47,17 @@ class NWSpellCheck(): return def setLanguage(self, theLang, projectDict=None): - """Dummy function. + """Default function. """ return def checkWord(self, theWord): - """Dummy function. + """Default function. """ return True def suggestWords(self, theWord): - """Dummy function. + """Default function. """ return [] @@ -78,12 +78,12 @@ class NWSpellCheck(): return False def listDictionaries(self): - """Dummy function. + """Default function. """ return [] def describeDict(self): - """Dummy function. + """Default function. """ return "", "" @@ -136,7 +136,7 @@ class NWSpellEnchant(NWSpellCheck): def setLanguage(self, theLang, projectDict=None): """Load a dictionary for the language specified in the config. - If that fails, we load a dummy dictionary so that lookups don't + If that fails, we load a mock dictionary so that lookups don't crash. """ try: diff --git a/nw/core/toodt.py b/nw/core/toodt.py index 0085ff64..ce67e8c0 100644 --- a/nw/core/toodt.py +++ b/nw/core/toodt.py @@ -563,7 +563,7 @@ class ToOdt(Tokenizer): ## if len(theText) != len(theFmt): - # Generate dummy format if there isn't any or it doesn't match + # Generate an empty format if there isn't any or it doesn't match theFmt = " "*len(theText) # XML functions diff --git a/nw/tools/build.py b/nw/tools/build.py index b4d5f36c..ac9ea364 100644 --- a/nw/tools/build.py +++ b/nw/tools/build.py @@ -173,7 +173,7 @@ class GuiBuildNovel(QDialog): if langIdx != -1: self.buildLang.setCurrentIndex(langIdx) - # Dummy boxes due to QGridView and QLineEdit expand bug + # Wrapper boxes due to QGridView and QLineEdit expand bug self.boxTitle = QHBoxLayout() self.boxTitle.addWidget(self.fmtTitle) self.boxChapter = QHBoxLayout() @@ -245,7 +245,7 @@ class GuiBuildNovel(QDialog): self.optState.getFloat("GuiBuildNovel", "lineHeight", 1.15) ) - # Dummy box due to QGridView and QLineEdit expand bug + # Wrapper box due to QGridView and QLineEdit expand bug self.boxFont = QHBoxLayout() self.boxFont.addWidget(self.textFont) diff --git a/tests/conftest.py b/tests/conftest.py index 36bf44d3..7c9925a5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -25,7 +25,7 @@ import pytest import shutil import os -from dummy import DummyMain +from mock import MockGuiMain from tools import cleanProject sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) @@ -88,8 +88,8 @@ def fncDir(tmpDir): if not os.path.isdir(fncDir): os.mkdir(fncDir) yield fncDir - if os.path.isdir(fncDir): - shutil.rmtree(fncDir) + # if os.path.isdir(fncDir): + # shutil.rmtree(fncDir) return @pytest.fixture(scope="function") @@ -136,12 +136,12 @@ def fncConf(fncDir): @pytest.fixture(scope="function") def dummyGUI(monkeypatch, tmpConf): - """Create a dummy instance of novelWriter's main GUI class. + """Create a mock instance of novelWriter's main GUI class. """ monkeypatch.setattr("nw.CONFIG", tmpConf) - theDummy = DummyMain() - theDummy.mainConf = tmpConf - return theDummy + theGui = MockGuiMain() + theGui.mainConf = tmpConf + return theGui @pytest.fixture(scope="function") def nwGUI(qtbot, monkeypatch, fncDir, fncConf): @@ -191,7 +191,7 @@ def nwMinimal(tmpDir): @pytest.fixture(scope="function") def nwLipsum(tmpDir): """A medium sized novelWriter example project with a lot of Lorem - Ipsum dummy text. + Ipsum text. """ tstDir = os.path.dirname(__file__) srcDir = os.path.join(tstDir, "lipsum") diff --git a/tests/dummy.py b/tests/mock.py similarity index 89% rename from tests/dummy.py rename to tests/mock.py index 14f2ef91..410d95ed 100644 --- a/tests/dummy.py +++ b/tests/mock.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ -novelWriter – Test Suite Dummy Classes -====================================== +novelWriter – Test Suite Mocked Classes +======================================= This file is a part of novelWriter Copyright 2018–2021, Veronica Berglyd Olsen @@ -24,14 +24,14 @@ along with this program. If not, see . # Mock GUI # =========================================================================== # -class DummyMain(): +class MockGuiMain(): def __init__(self): self.mainConf = None self.hasProject = True self.theIndex = None self.theProject = None - self.statusBar = DummyStatusBar() + self.statusBar = MockStatusBar() # Test Variables self.askResponse = True @@ -79,9 +79,9 @@ class DummyMain(): self.lastAlert = "" return -# END Class DummyMain +# END Class MockGuiMain -class DummyStatusBar(): +class MockStatusBar(): def __init__(self): return @@ -89,9 +89,9 @@ class DummyStatusBar(): def setStatus(self, theText): return -# END Class DummyStatusBar +# END Class MockStatusBar -class DummyApp: +class MockApp: def __init__(self): return @@ -99,11 +99,11 @@ class DummyApp: def installTranslator(self, theLang): return -# END Class DummyApp +# END Class MockApp # =========================================================================== # # Error Functions -# Dummy functions that will raise errors instead. +# Mock functions that will raise errors instead. # =========================================================================== # def causeOSError(*args, **kwargs): diff --git a/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd b/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd index c77c3cd6..65bcb039 100644 --- a/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd +++ b/tests/reference/guiEditor_Main_Final_0e17daca5f3e1.nwd @@ -19,9 +19,9 @@ @char: Jane -This is a paragraph of dummy text. +This is a paragraph of nonsense text. -This is another paragraph of much longer dummy text. It is in fact 1 very very DUMB dummy text! We can also try replacing “quotes”, even single ‘quotes’ are replaced. Isn’t that nice? We can hyphen-ate, make dashes – and even longer dashes — if we want. Ellipsis? Not a problem either … How about three hyphens — for long dash? It works too. +This is another paragraph of much longer nonsense text. It is in fact 1 very very NONSENSICAL nonsense text! We can also try replacing “quotes”, even single ‘quotes’ are replaced. Isn’t that nice? We can hyphen-ate, make dashes – and even longer dashes — if we want. Ellipsis? Not a problem either … How about three hyphens — for long dash? It works too. “Full line double quoted text.” diff --git a/tests/reference/guiEditor_Main_Final_nwProject.nwx b/tests/reference/guiEditor_Main_Final_nwProject.nwx index 6e511bca..861888fa 100644 --- a/tests/reference/guiEditor_Main_Final_nwProject.nwx +++ b/tests/reference/guiEditor_Main_Final_nwProject.nwx @@ -85,10 +85,10 @@ New True BOOK - 466 + 482 83 4 - 604 + 620 Plot diff --git a/tests/test_base/test_base_config.py b/tests/test_base/test_base_config.py index c755b6a0..aaedc4af 100644 --- a/tests/test_base/test_base_config.py +++ b/tests/test_base/test_base_config.py @@ -27,7 +27,7 @@ import configparser from shutil import copyfile -from dummy import causeOSError, DummyApp +from mock import causeOSError, MockApp from tools import cmpFiles, writeFile from nw.config import Config @@ -195,7 +195,7 @@ def testBaseConfig_Init(monkeypatch, tmpDir, fncDir, outDir, refDir, filesDir): writeFile(os.path.join(i18nDir, "nw_en_GB.ts"), "") writeFile(os.path.join(i18nDir, "nw_abcd.qm"), "") - tstApp = DummyApp() + tstApp = MockApp() tstConf.initLocalisation(tstApp) theList = tstConf.listLanguages(tstConf.LANG_NW) assert theList == [("en_GB", "British English")] @@ -252,7 +252,7 @@ def testBaseConfig_RecentCache(monkeypatch, tmpConf, tmpDir, fncDir): } # Remove Non-Existent Entry - assert not tmpConf.removeFromRecentCache("dummy") + assert not tmpConf.removeFromRecentCache("stuff") assert tmpConf.recentProj == { pathOne: {"time": 1600002000, "title": "Proj One", "words": 100}, pathTwo: {"time": 1600005600, "title": "Proj Two", "words": 200}, @@ -490,7 +490,7 @@ def testBaseConfig_Internal(monkeypatch, tmpConf): cnfParse = configparser.ConfigParser() cnfParse.read_string( "[Main]\n" - "val_string = dummy\n" + "val_string = stuff\n" "val_int = 123\n" "val_bool = True\n" "val_list_string = A, B, C\n" @@ -499,7 +499,7 @@ def testBaseConfig_Internal(monkeypatch, tmpConf): assert tmpConf._parseLine( cnfParse, "Main", "val_string", tmpConf.CNF_STR, "default" - ) == "dummy" + ) == "stuff" assert tmpConf._parseLine( cnfParse, "Main", "nope", tmpConf.CNF_STR, "default" ) == "default" @@ -554,7 +554,7 @@ def testBaseConfig_Internal(monkeypatch, tmpConf): assert tmpConf.hasEnchant is False with monkeypatch.context() as mp: - mp.setattr("shutil.which", lambda *args: "dummy") + mp.setattr("shutil.which", lambda *args: "stuff") tmpConf._checkOptionalPackages() assert tmpConf.hasAssistant is True diff --git a/tests/test_base/test_base_error.py b/tests/test_base/test_base_error.py index 9976fae2..29bec978 100644 --- a/tests/test_base/test_base_error.py +++ b/tests/test_base/test_base_error.py @@ -25,7 +25,7 @@ import pytest from PyQt5.QtWidgets import qApp -from dummy import causeException +from mock import causeException from nw.error import NWErrorMessage, exceptionHandler diff --git a/tests/test_base/test_base_init.py b/tests/test_base/test_base_init.py index fb906786..2bcf9a61 100644 --- a/tests/test_base/test_base_init.py +++ b/tests/test_base/test_base_init.py @@ -25,19 +25,19 @@ import pytest import logging import sys -from dummy import DummyMain +from mock import MockGuiMain @pytest.mark.base def testBaseInit_Launch(caplog, monkeypatch, tmpDir): """Check launching the main GUI. """ - monkeypatch.setattr("nw.guimain.GuiMain", DummyMain) + monkeypatch.setattr("nw.guimain.GuiMain", MockGuiMain) # Testmode launch nwGUI = nw.main( ["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) - assert isinstance(nwGUI, DummyMain) + assert isinstance(nwGUI, MockGuiMain) # Darwin launch monkeypatch.setitem(sys.modules, "Foundation", None) @@ -46,7 +46,7 @@ def testBaseInit_Launch(caplog, monkeypatch, tmpDir): nwGUI = nw.main( ["--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir] ) - assert isinstance(nwGUI, DummyMain) + assert isinstance(nwGUI, MockGuiMain) assert "Foundation" in caplog.messages[1] nw.CONFIG.osDarwin = osDarwin @@ -68,7 +68,7 @@ def testBaseInit_Launch(caplog, monkeypatch, tmpDir): def testBaseInit_Options(monkeypatch, tmpDir): """Test command line options for logging level. """ - monkeypatch.setattr("nw.guimain.GuiMain", DummyMain) + monkeypatch.setattr("nw.guimain.GuiMain", MockGuiMain) monkeypatch.setattr(sys, "argv", [ "novelWriter.py", "--testmode", "--config=%s" % tmpDir, "--data=%s" % tmpDir ]) @@ -140,7 +140,7 @@ def testBaseInit_Options(monkeypatch, tmpDir): def testBaseInit_Imports(caplog, monkeypatch, tmpDir): """Check import error handling. """ - monkeypatch.setattr("nw.guimain.GuiMain", DummyMain) + monkeypatch.setattr("nw.guimain.GuiMain", MockGuiMain) monkeypatch.setattr("PyQt5.QtWidgets.QApplication.__init__", lambda *args: None) monkeypatch.setattr("PyQt5.QtWidgets.QApplication.exec_", lambda *args: 0) monkeypatch.setattr("PyQt5.QtWidgets.QErrorMessage.__init__", lambda *args: None) diff --git a/tests/test_core/test_core_document.py b/tests/test_core/test_core_document.py index 82028d61..42df9d1c 100644 --- a/tests/test_core/test_core_document.py +++ b/tests/test_core/test_core_document.py @@ -23,7 +23,7 @@ along with this program. If not, see . import os import pytest -from dummy import causeOSError +from mock import causeOSError from nw.core import NWProject, NWDoc from nw.enum import nwItemClass, nwItemLayout @@ -39,7 +39,7 @@ def testCoreDocument_LoadSave(monkeypatch, dummyGUI, nwMinimal): sHandle = "8c659a11cd429" # Not a valid handle - theDoc = NWDoc(theProject, "dummy") + theDoc = NWDoc(theProject, "stuff") assert theDoc.readDocument() is None # Non-existent handle @@ -102,7 +102,7 @@ def testCoreDocument_LoadSave(monkeypatch, dummyGUI, nwMinimal): assert not theDoc.writeDocument(theText) # Delete the last document - theDoc = NWDoc(theProject, "dummy") + theDoc = NWDoc(theProject, "stuff") assert not theDoc.deleteDocument() assert os.path.isfile(docPath) diff --git a/tests/test_core/test_core_index.py b/tests/test_core/test_core_index.py index 7dc5c9f8..87ce2b02 100644 --- a/tests/test_core/test_core_index.py +++ b/tests/test_core/test_core_index.py @@ -26,7 +26,7 @@ import json from shutil import copyfile -from dummy import causeException +from mock import causeException from tools import cmpFiles from nw.core.project import NWProject diff --git a/tests/test_core/test_core_options.py b/tests/test_core/test_core_options.py index 6bd26b29..c1ef5209 100644 --- a/tests/test_core/test_core_options.py +++ b/tests/test_core/test_core_options.py @@ -24,7 +24,7 @@ import os import json import pytest -from dummy import causeOSError +from mock import causeOSError from nw.core import NWProject from nw.core.options import OptionState diff --git a/tests/test_core/test_core_project.py b/tests/test_core/test_core_project.py index 8eb918ec..2f016b38 100644 --- a/tests/test_core/test_core_project.py +++ b/tests/test_core/test_core_project.py @@ -28,7 +28,7 @@ from zipfile import ZipFile from lxml import etree from tools import cmpFiles, writeFile, readFile -from dummy import causeOSError +from mock import causeOSError from nw.core.project import NWProject from nw.enum import nwItemClass, nwItemType, nwItemLayout @@ -354,11 +354,11 @@ def testCoreProject_Open(monkeypatch, nwMinimal, dummyGUI): oName = os.path.join(nwMinimal, nwFiles.PROJ_FILE[:-3]+"orig") bName = os.path.join(nwMinimal, nwFiles.PROJ_FILE[:-3]+"bak") os.rename(rName, oName) - writeFile(rName, "dummy") + writeFile(rName, "stuff") assert theProject.openProject(nwMinimal) is False # Also write a jun XML backup file - writeFile(bName, "dummy") + writeFile(bName, "stuff") assert theProject.openProject(nwMinimal) is False # Wrong root item @@ -426,9 +426,9 @@ def testCoreProject_Open(monkeypatch, nwMinimal, dummyGUI): os.rename(oName, rName) # Add some legacy stuff that cannot be removed - writeFile(os.path.join(nwMinimal, "junk"), "dummy") + writeFile(os.path.join(nwMinimal, "junk"), "stuff") os.mkdir(os.path.join(nwMinimal, "data_0")) - writeFile(os.path.join(nwMinimal, "data_0", "junk"), "dummy") + writeFile(os.path.join(nwMinimal, "data_0", "junk"), "stuff") dummyGUI.clear() assert theProject.openProject(nwMinimal) is True assert "data_0" in dummyGUI.lastAlert @@ -559,19 +559,19 @@ def testCoreProject_Helpers(monkeypatch, fncDir, dummyGUI): # Create a file to block meta folder metaDir = os.path.join(fncDir, "meta") - writeFile(metaDir, "dummy") + writeFile(metaDir, "stuff") assert theProject.ensureFolderStructure() is False os.unlink(metaDir) # Create a file to block cache folder cacheDir = os.path.join(fncDir, "cache") - writeFile(cacheDir, "dummy") + writeFile(cacheDir, "stuff") assert theProject.ensureFolderStructure() is False os.unlink(cacheDir) # Create a file to block content folder contentDir = os.path.join(fncDir, "content") - writeFile(contentDir, "dummy") + writeFile(contentDir, "stuff") assert theProject.ensureFolderStructure() is False os.unlink(contentDir) @@ -977,7 +977,7 @@ def testCoreProject_OldFormat(dummyGUI, nwOldProj): """ theProject = NWProject(dummyGUI) - # Create dummy files for known legacy files + # Create mock files for known legacy files deleteFiles = [ os.path.join(nwOldProj, "cache", "nwProject.nwx.0"), os.path.join(nwOldProj, "cache", "nwProject.nwx.1"), @@ -1005,7 +1005,7 @@ def testCoreProject_OldFormat(dummyGUI, nwOldProj): os.mkdir(os.path.join(nwOldProj, "stuff")) os.mkdir(os.path.join(nwOldProj, "data_1", "stuff")) - # Create dummy files + # Create mock files os.mkdir(os.path.join(nwOldProj, "cache")) for aFile in deleteFiles: writeFile(aFile, "Hi") @@ -1071,7 +1071,7 @@ def testCoreProject_LegacyData(monkeypatch, dummyGUI, fncDir): # Check behaviour of deprecated files function on OSError tstFile = os.path.join(fncDir, "ToC.json") - writeFile(tstFile, "dummy") + writeFile(tstFile, "stuff") assert os.path.isfile(tstFile) with monkeypatch.context() as mp: @@ -1083,7 +1083,7 @@ def testCoreProject_LegacyData(monkeypatch, dummyGUI, fncDir): # Check processing non-folders tstFile = os.path.join(fncDir, "data_0") - writeFile(tstFile, "dummy") + writeFile(tstFile, "stuff") assert os.path.isfile(tstFile) errList = [] @@ -1128,12 +1128,12 @@ def testCoreProject_LegacyData(monkeypatch, dummyGUI, fncDir): tstDoc3b = os.path.join(tstData, "tooshort003_main.bak") os.mkdir(tstData) - writeFile(tstDoc1m, "dummy") - writeFile(tstDoc1b, "dummy") - writeFile(tstDoc2m, "dummy") - writeFile(tstDoc2b, "dummy") - writeFile(tstDoc3m, "dummy") - writeFile(tstDoc3b, "dummy") + writeFile(tstDoc1m, "stuff") + writeFile(tstDoc1b, "stuff") + writeFile(tstDoc2m, "stuff") + writeFile(tstDoc2b, "stuff") + writeFile(tstDoc3m, "stuff") + writeFile(tstDoc3b, "stuff") # Make the above fail with monkeypatch.context() as mp: diff --git a/tests/test_core/test_core_spell.py b/tests/test_core/test_core_spell.py index c1d8ae3d..4c3f3527 100644 --- a/tests/test_core/test_core_spell.py +++ b/tests/test_core/test_core_spell.py @@ -24,7 +24,7 @@ import os import sys import pytest -from dummy import causeOSError +from mock import causeOSError from tools import readFile, writeFile from nw.core.spellcheck import NWSpellCheck, NWSpellEnchant, NWSpellSimple @@ -38,7 +38,7 @@ def testCoreSpell_Super(monkeypatch, tmpDir): spChk = NWSpellCheck() - # Check that dummy functions return results that reflects that spell + # Check that default functions return results that reflects that spell # checking is effectively disabled assert spChk.setLanguage("", "") is None assert spChk.checkWord("") @@ -47,7 +47,7 @@ def testCoreSpell_Super(monkeypatch, tmpDir): assert spChk.describeDict() == ("", "") # Add a word to the user's dictionary - assert spChk._readProjectDictionary("dummy") is False + assert spChk._readProjectDictionary("stuff") is False with monkeypatch.context() as mp: mp.setattr("builtins.open", causeOSError) assert spChk._readProjectDictionary(wList) is False @@ -77,7 +77,7 @@ def testCoreSpell_Enchant(monkeypatch, tmpDir): wList = os.path.join(tmpDir, "wordlist.txt") writeFile(wList, "a_word\nb_word\nc_word\n") - # Block the enchant package (and trigger the dummy class) + # Block the enchant package (and trigger the default class) with monkeypatch.context() as mp: mp.setitem(sys.modules, "enchant", None) spChk = NWSpellEnchant() diff --git a/tests/test_core/test_core_status.py b/tests/test_core/test_core_status.py index ee2ea24e..d3cd7f86 100644 --- a/tests/test_core/test_core_status.py +++ b/tests/test_core/test_core_status.py @@ -49,7 +49,7 @@ def testCoreStatus_Entries(): # Lookups assert theStatus.lookupEntry(None) is None - assert theStatus.lookupEntry("dummy") is None + assert theStatus.lookupEntry("stuff") is None assert theStatus.lookupEntry("Main") == 3 # Checks diff --git a/tests/test_core/test_core_tokenizer.py b/tests/test_core/test_core_tokenizer.py index e766450b..0f4d9f85 100644 --- a/tests/test_core/test_core_tokenizer.py +++ b/tests/test_core/test_core_tokenizer.py @@ -145,13 +145,13 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, dummyGUI): assert theProject.saveProject() # Root heading - assert theToken.addRootHeading("dummy") is False + assert theToken.addRootHeading("stuff") is False assert theToken.addRootHeading(sHandle) is False assert theToken.addRootHeading("7695ce551d265") is True assert theToken.theMarkdown[-1] == "# Notes: Plot\n\n" # Set text - assert theToken.setText("dummy") is False + assert theToken.setText("stuff") is False assert theToken.setText(sHandle) is True assert theToken.theText == docText diff --git a/tests/test_core/test_core_tree.py b/tests/test_core/test_core_tree.py index 803e88c4..8f51b906 100644 --- a/tests/test_core/test_core_tree.py +++ b/tests/test_core/test_core_tree.py @@ -31,7 +31,7 @@ from nw.constants import nwFiles @pytest.fixture(scope="function") def dummyItems(dummyGUI): - """Create a list of dummy items. + """Create a list of mock items. """ theProject = NWProject(dummyGUI) @@ -176,7 +176,7 @@ def testCoreTree_BuildTree(dummyGUI, dummyItems): assert len(theTree) == len(dummyItems) + 1 # Delete a non-existing item - del theTree["dummy"] + del theTree["stuff"] assert len(theTree) == len(dummyItems) + 1 # Delete the last item @@ -214,7 +214,7 @@ def testCoreTree_Methods(dummyGUI, dummyItems): assert len(theTree) == len(dummyItems) # Root item lookup - theTree._treeRoots.append("dummy") + theTree._treeRoots.append("stuff") assert theTree.findRoot(nwItemClass.WORLD) is None assert theTree.findRoot(nwItemClass.NOVEL) == "a000000000001" assert theTree.findRoot(nwItemClass.CHARACTER) == "a000000000004" @@ -229,16 +229,16 @@ def testCoreTree_Methods(dummyGUI, dummyItems): assert theTree.getRootItem("b000000000001").itemHandle == "a000000000001" assert theTree.getRootItem("c000000000001").itemHandle == "a000000000001" assert theTree.getRootItem("c000000000002").itemHandle == "a000000000001" - assert theTree.getRootItem("dummy") is None + assert theTree.getRootItem("stuff") is None # Get item path - assert theTree.getItemPath("dummy") == [] + assert theTree.getItemPath("stuff") == [] assert theTree.getItemPath("c000000000001") == [ "c000000000001", "b000000000001", "a000000000001" ] # Break the folder parent handle - theTree["b000000000001"].itemParent = "dummy" + theTree["b000000000001"].itemParent = "stuff" assert theTree.getItemPath("c000000000001") == [ "c000000000001", "b000000000001" ] @@ -249,7 +249,7 @@ def testCoreTree_Methods(dummyGUI, dummyItems): ] # Change file layout - assert not theTree.setFileItemLayout("dummy", nwItemLayout.UNNUMBERED) + assert not theTree.setFileItemLayout("stuff", nwItemLayout.UNNUMBERED) assert not theTree.setFileItemLayout("b000000000001", nwItemLayout.UNNUMBERED) assert not theTree.setFileItemLayout("c000000000001", "stuff") assert theTree.setFileItemLayout("c000000000001", nwItemLayout.UNNUMBERED) @@ -424,7 +424,7 @@ def testCoreTree_Stats(dummyGUI, dummyItems): theTree.append(tHandle, pHandle, nwItem) assert len(theTree) == len(dummyItems) - theTree._treeOrder.append("dummy") + theTree._treeOrder.append("stuff") # Count Words novelWords, noteWords = theTree.sumWords() @@ -461,10 +461,10 @@ def testCoreTree_Reorder(dummyGUI, dummyItems): theTree.setOrder(bHandle) assert theTree.handles() == bHandle - theTree.setOrder(bHandle + ["dummy"]) + theTree.setOrder(bHandle + ["stuff"]) assert theTree.handles() == bHandle - theTree._treeOrder.append("dummy") + theTree._treeOrder.append("stuff") theTree.setOrder(bHandle) assert theTree.handles() == bHandle @@ -536,7 +536,7 @@ def testCoreTree_ToCFile(monkeypatch, dummyGUI, dummyItems, tmpDir): theTree.append(tHandle, pHandle, nwItem) assert len(theTree) == len(dummyItems) - theTree._treeOrder.append("dummy") + theTree._treeOrder.append("stuff") def dummyIsFile(fileName): """Return True for items that are files in novelWriter and diff --git a/tests/test_dialogs/test_dlg_wordlist.py b/tests/test_dialogs/test_dlg_wordlist.py index 6cd7b4ee..31cfb9e0 100644 --- a/tests/test_dialogs/test_dlg_wordlist.py +++ b/tests/test_dialogs/test_dlg_wordlist.py @@ -26,7 +26,7 @@ from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QDialog, QMessageBox, QAction from tools import writeFile, readFile, getGuiItem -from dummy import causeOSError +from mock import causeOSError from nw.dialogs import GuiWordList from nw.constants import nwFiles diff --git a/tests/test_gui/test_gui_doceditor.py b/tests/test_gui/test_gui_doceditor.py index 12ac5949..451f1f47 100644 --- a/tests/test_gui/test_gui_doceditor.py +++ b/tests/test_gui/test_gui_doceditor.py @@ -249,14 +249,14 @@ def testGuiEditor_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir, outDi qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay) qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay) - for c in "This is a paragraph of dummy text.": + for c in "This is a paragraph of nonsense text.": qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay) qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay) qtbot.keyClick(nwGUI.docEditor, Qt.Key_Return, delay=keyDelay) for c in ( - "This is another paragraph of much longer dummy text. " - "It is in fact 1 very very DUMB dummy text! " + "This is another paragraph of much longer nonsense text. " + "It is in fact 1 very very NONSENSICAL nonsense text! " ): qtbot.keyClick(nwGUI.docEditor, c, delay=typeDelay) for c in "We can also try replacing \"quotes\", even single 'quotes' are replaced. ": diff --git a/tests/test_gui/test_gui_theme.py b/tests/test_gui/test_gui_theme.py index ce719ea2..0e6b1e34 100644 --- a/tests/test_gui/test_gui_theme.py +++ b/tests/test_gui/test_gui_theme.py @@ -165,7 +165,7 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir): assert isinstance(anIcon, QIcon) assert not anIcon.isNull() - # Add dummy icons and test alternative load paths + # Add test icons and test alternative load paths theIcons.ICON_MAP["testicon1"] = (QStyle.SP_DriveHDIcon, None) anIcon = theIcons.getIcon("testicon1") assert isinstance(anIcon, QIcon) diff --git a/tests/test_tools/test_tools_writingstats.py b/tests/test_tools/test_tools_writingstats.py index c72de22c..10f4fddc 100644 --- a/tests/test_tools/test_tools_writingstats.py +++ b/tests/test_tools/test_tools_writingstats.py @@ -25,7 +25,7 @@ import json import os from tools import getGuiItem, writeFile -from dummy import causeOSError +from mock import causeOSError from PyQt5.QtCore import Qt from PyQt5.QtWidgets import QAction, QFileDialog, QMessageBox