Some code flow improvements and main GUI test coverage
This commit is contained in:
@@ -54,8 +54,10 @@ def resetConfigVars():
|
||||
CONFIG.setBackupPath(_TMP_ROOT)
|
||||
CONFIG.setGuiFont(None)
|
||||
CONFIG.setTextFont(None)
|
||||
CONFIG.backupOnClose = False
|
||||
CONFIG._homePath = _TMP_ROOT
|
||||
CONFIG._dLocale = QLocale("en_GB")
|
||||
CONFIG.pdfDocs = _TMP_ROOT / "manual.pdf"
|
||||
CONFIG.guiLocale = "en_GB"
|
||||
return
|
||||
|
||||
@@ -72,6 +74,7 @@ def sessionFixture():
|
||||
shutil.rmtree(_TMP_ROOT)
|
||||
_TMP_ROOT.mkdir()
|
||||
_TMP_CONF.mkdir()
|
||||
(_TMP_ROOT / "manual.pdf").touch()
|
||||
return
|
||||
|
||||
|
||||
@@ -161,6 +164,7 @@ def nwGUI(qtbot, monkeypatch, functionFixture):
|
||||
monkeypatch.setattr(QMessageBox, "result", lambda *a: QMessageBox.StandardButton.Yes)
|
||||
|
||||
nwGUI = main(["--testmode", f"--config={_TMP_CONF}", f"--data={_TMP_CONF}"])
|
||||
assert nwGUI is not None
|
||||
qtbot.addWidget(nwGUI)
|
||||
resetConfigVars()
|
||||
nwGUI.docEditor.initEditor()
|
||||
|
||||
Reference in New Issue
Block a user