Fix tests and a bug in GuiMain

This commit is contained in:
Veronica K. B. Olsen
2021-02-15 16:48:12 +01:00
parent df19ced50c
commit 8087e8ad75
7 changed files with 13 additions and 12 deletions
+2 -2
View File
@@ -702,9 +702,9 @@ class GuiMain(QMainWindow):
lastPath = self.mainConf.lastPath lastPath = self.mainConf.lastPath
extFilter = [ extFilter = [
self.tr("{0} ({1})").format(self.tr("Text files"), "*.txt"), self.tr("{0} ({1})").format(self.tr("Text files"), "*.txt"),
self.tr("{0} ({1})").format(self.tr("Markdown files")), self.tr("{0} ({1})").format(self.tr("Markdown files"), "*.md"),
self.tr("{0} ({1})").format(self.tr("novelWriter files"), "*.nwd"), self.tr("{0} ({1})").format(self.tr("novelWriter files"), "*.nwd"),
self.tr("{0} ({1})").format(self.tr("All files")), self.tr("{0} ({1})").format(self.tr("All files"), "*.*"),
] ]
dlgOpt = QFileDialog.Options() dlgOpt = QFileDialog.Options()
dlgOpt |= QFileDialog.DontUseNativeDialog dlgOpt |= QFileDialog.DontUseNativeDialog
+2 -1
View File
@@ -1,5 +1,5 @@
[Main] [Main]
timestamp = 2021-02-09 21:07:03 timestamp = 2021-02-15 16:31:24
theme = default theme = default
syntax = default_light syntax = default_light
icons = typicons_colour_light icons = typicons_colour_light
@@ -7,6 +7,7 @@ guidark = False
guifont = guifont =
guifontsize = 11 guifontsize = 11
lastnotes = 0x0 lastnotes = 0x0
guilang = en-GB
[Sizes] [Sizes]
geometry = 1200, 650 geometry = 1200, 650
@@ -7,6 +7,7 @@ guidark = True
guifont = Sans guifont = Sans
guifontsize = 12 guifontsize = 12
lastnotes = 0x0 lastnotes = 0x0
guilang = en-GB
[Sizes] [Sizes]
geometry = 1200, 650 geometry = 1200, 650
+1 -1
View File
@@ -962,7 +962,7 @@ def testCoreProject_OrphanedFiles(dummyGUI, nwLipsum):
# First Item with Meta Data # First Item with Meta Data
oItem = theProject.projTree["636b6aa9b697b"] oItem = theProject.projTree["636b6aa9b697b"]
assert oItem is not None assert oItem is not None
assert oItem.itemName == "Recovered: Mars" assert oItem.itemName == "[Recovered] Mars"
assert oItem.itemHandle == "636b6aa9b697b" assert oItem.itemHandle == "636b6aa9b697b"
assert oItem.itemParent == "60bdf227455cc" assert oItem.itemParent == "60bdf227455cc"
assert oItem.itemClass == nwItemClass.WORLD assert oItem.itemClass == nwItemClass.WORLD
+1 -1
View File
@@ -168,6 +168,6 @@ def testCoreSpell_Simple(monkeypatch, tmpDir, tmpConf):
assert "D_word" in wSuggest assert "D_word" in wSuggest
# List dictionaries # List dictionaries
assert spChk.listDictionaries() == [("en", "English [%s]" % nwConst.SP_INTERNAL)] assert spChk.listDictionaries() == [("en", "difflib")]
# END Test testCoreSpell_Simple # END Test testCoreSpell_Simple
+3 -4
View File
@@ -595,10 +595,9 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
nwGUI.mainMenu.aFileDetails.activate(QAction.Trigger) nwGUI.mainMenu.aFileDetails.activate(QAction.Trigger)
theBits = theMessage.split("<br>") theBits = theMessage.split("<br>")
assert len(theBits) == 3 assert len(theBits) == 2
assert theBits[0] == "File details for the currently open file" assert theBits[0] == "The currently open file is saved in:"
assert theBits[1] == "Handle: 0e17daca5f3e1" assert theBits[1] == os.path.join(fncProj, "content", "0e17daca5f3e1.nwd")
assert theBits[2] == "Location: %s" % os.path.join(fncProj, "content", "0e17daca5f3e1.nwd")
# qtbot.stopForInteraction() # qtbot.stopForInteraction()
+3 -3
View File
@@ -248,9 +248,9 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
ignoreLines = [ ignoreLines = [
2, # Timestamp 2, # Timestamp
9, # Release Notes 9, # Release Notes
12, 13, 14, 15, # Window sizes 13, 14, 15, 16, # Window sizes
16, 17, 18, 19, # Window sizes 17, 18, 19, 20, # Window sizes
7, 29, # Fonts (depends on system default) 7, 30, 31, # Fonts (depends on system default)
] ]
assert cmpFiles(testFile, compFile, ignoreLines) assert cmpFiles(testFile, compFile, ignoreLines)