Fix and update tests
This commit is contained in:
@@ -6,6 +6,7 @@ icons = typicons_colour_light
|
|||||||
guidark = False
|
guidark = False
|
||||||
guifont =
|
guifont =
|
||||||
guifontsize = 11
|
guifontsize = 11
|
||||||
|
lastnotes = 1.0
|
||||||
|
|
||||||
[Sizes]
|
[Sizes]
|
||||||
geometry = 1200, 650
|
geometry = 1200, 650
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ icons = typicons_colour_light
|
|||||||
guidark = True
|
guidark = True
|
||||||
guifont = Cantarell
|
guifont = Cantarell
|
||||||
guifontsize = 12
|
guifontsize = 12
|
||||||
|
lastnotes = 1.0
|
||||||
|
|
||||||
[Sizes]
|
[Sizes]
|
||||||
geometry = 1100, 650
|
geometry = 1100, 650
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ def testConfigCore(tmpConf, nwTemp, nwRef):
|
|||||||
|
|
||||||
assert tmpConf.confPath == nwTemp
|
assert tmpConf.confPath == nwTemp
|
||||||
assert tmpConf.saveConfig()
|
assert tmpConf.saveConfig()
|
||||||
assert cmpFiles(testConf, refConf, [2])
|
assert cmpFiles(testConf, refConf, [2, 9])
|
||||||
assert not tmpConf.confChanged
|
assert not tmpConf.confChanged
|
||||||
|
|
||||||
assert tmpConf.loadConfig()
|
assert tmpConf.loadConfig()
|
||||||
@@ -51,7 +51,7 @@ def testConfigSetWinSize(tmpConf, nwTemp, nwRef):
|
|||||||
assert tmpConf.setWinSize(1200, 650)
|
assert tmpConf.setWinSize(1200, 650)
|
||||||
assert tmpConf.saveConfig()
|
assert tmpConf.saveConfig()
|
||||||
|
|
||||||
assert cmpFiles(testConf, refConf, [2])
|
assert cmpFiles(testConf, refConf, [2, 9])
|
||||||
assert not tmpConf.confChanged
|
assert not tmpConf.confChanged
|
||||||
|
|
||||||
@pytest.mark.core
|
@pytest.mark.core
|
||||||
@@ -73,7 +73,7 @@ def testConfigSetTreeColWidths(tmpConf, nwTemp, nwRef):
|
|||||||
assert tmpConf.confChanged
|
assert tmpConf.confChanged
|
||||||
assert tmpConf.saveConfig()
|
assert tmpConf.saveConfig()
|
||||||
|
|
||||||
assert cmpFiles(testConf, refConf, [2])
|
assert cmpFiles(testConf, refConf, [2, 9])
|
||||||
assert not tmpConf.confChanged
|
assert not tmpConf.confChanged
|
||||||
|
|
||||||
@pytest.mark.core
|
@pytest.mark.core
|
||||||
@@ -109,7 +109,7 @@ def testConfigSetPanePos(tmpConf, nwTemp, nwRef):
|
|||||||
assert tmpConf.confChanged
|
assert tmpConf.confChanged
|
||||||
assert tmpConf.saveConfig()
|
assert tmpConf.saveConfig()
|
||||||
|
|
||||||
assert cmpFiles(testConf, refConf, [2])
|
assert cmpFiles(testConf, refConf, [2, 9])
|
||||||
assert not tmpConf.confChanged
|
assert not tmpConf.confChanged
|
||||||
|
|
||||||
@pytest.mark.core
|
@pytest.mark.core
|
||||||
@@ -133,7 +133,7 @@ def testConfigFlags(tmpConf, nwTemp, nwRef):
|
|||||||
assert tmpConf.confChanged
|
assert tmpConf.confChanged
|
||||||
assert tmpConf.saveConfig()
|
assert tmpConf.saveConfig()
|
||||||
|
|
||||||
assert cmpFiles(testConf, refConf, [2])
|
assert cmpFiles(testConf, refConf, [2, 9])
|
||||||
assert not tmpConf.confChanged
|
assert not tmpConf.confChanged
|
||||||
|
|
||||||
@pytest.mark.core
|
@pytest.mark.core
|
||||||
|
|||||||
+11
-2
@@ -374,12 +374,20 @@ def testAboutBox(qtbot, monkeypatch, nwFuncTemp, nwTemp):
|
|||||||
msgAbout.show()
|
msgAbout.show()
|
||||||
|
|
||||||
assert msgAbout.pageAbout.document().characterCount() > 100
|
assert msgAbout.pageAbout.document().characterCount() > 100
|
||||||
|
assert msgAbout.pageNotes.document().characterCount() > 100
|
||||||
assert msgAbout.pageLicense.document().characterCount() > 100
|
assert msgAbout.pageLicense.document().characterCount() > 100
|
||||||
|
|
||||||
msgAbout.mainConf.guiLang = "whatever"
|
msgAbout.mainConf.guiLang = "whatever"
|
||||||
|
|
||||||
|
msgAbout._fillNotesPage()
|
||||||
|
assert msgAbout.pageNotes.toPlainText() == "Error loading release notes text ..."
|
||||||
|
|
||||||
msgAbout._fillLicensePage()
|
msgAbout._fillLicensePage()
|
||||||
assert msgAbout.pageLicense.toPlainText() == "Error loading license text ..."
|
assert msgAbout.pageLicense.toPlainText() == "Error loading license text ..."
|
||||||
|
|
||||||
|
msgAbout.showReleaseNotes()
|
||||||
|
assert msgAbout.tabBox.currentWidget() == msgAbout.pageNotes
|
||||||
|
|
||||||
# Qt About
|
# Qt About
|
||||||
monkeypatch.setattr(QMessageBox, "aboutQt", lambda *args, **kwargs: None)
|
monkeypatch.setattr(QMessageBox, "aboutQt", lambda *args, **kwargs: None)
|
||||||
nwGUI.mainMenu.aAboutQt.activate(QAction.Trigger)
|
nwGUI.mainMenu.aAboutQt.activate(QAction.Trigger)
|
||||||
@@ -1201,8 +1209,9 @@ def testPreferences(qtbot, monkeypatch, yesToAll, nwMinimal, nwTemp, nwRef, tmpC
|
|||||||
copyfile(projConf, testConf)
|
copyfile(projConf, testConf)
|
||||||
ignoreLines = [
|
ignoreLines = [
|
||||||
2, # Timestamp
|
2, # Timestamp
|
||||||
11, 12, 13, 14, 15, 16, 17, # Window sizes
|
9, # Release Notes
|
||||||
7, 27, # Fonts (depends on system default)
|
12, 13, 14, 15, 16, 17, 18, # Window sizes
|
||||||
|
7, 28, # Fonts (depends on system default)
|
||||||
]
|
]
|
||||||
assert cmpFiles(testConf, refConf, ignoreLines)
|
assert cmpFiles(testConf, refConf, ignoreLines)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user