Fix a minor issue in the Preferences test
This commit is contained in:
@@ -35,6 +35,7 @@ from PyQt5.QtWidgets import (
|
|||||||
from nw.gui import GuiPreferences
|
from nw.gui import GuiPreferences
|
||||||
from nw.config import Config
|
from nw.config import Config
|
||||||
from nw.gui.custom import QuotesDialog
|
from nw.gui.custom import QuotesDialog
|
||||||
|
from nw.constants import nwConst
|
||||||
|
|
||||||
keyDelay = 2
|
keyDelay = 2
|
||||||
typeDelay = 1
|
typeDelay = 1
|
||||||
@@ -67,6 +68,7 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
|
|||||||
|
|
||||||
theConf = nwGUI.mainConf
|
theConf = nwGUI.mainConf
|
||||||
assert theConf.confPath == fncDir
|
assert theConf.confPath == fncDir
|
||||||
|
theConf.spellTool = nwConst.SP_INTERNAL
|
||||||
|
|
||||||
monkeypatch.setattr(GuiPreferences, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiPreferences, "exec_", lambda *args: None)
|
||||||
monkeypatch.setattr(GuiPreferences, "result", lambda *args: QDialog.Accepted)
|
monkeypatch.setattr(GuiPreferences, "result", lambda *args: QDialog.Accepted)
|
||||||
@@ -121,6 +123,8 @@ def testGuiPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
|
|||||||
qtbot.mouseClick(tabProjects.backupOnClose, Qt.LeftButton)
|
qtbot.mouseClick(tabProjects.backupOnClose, Qt.LeftButton)
|
||||||
assert tabProjects.backupOnClose.isChecked()
|
assert tabProjects.backupOnClose.isChecked()
|
||||||
|
|
||||||
|
# qtbot.stopForInteraction()
|
||||||
|
|
||||||
# Check Browse button
|
# Check Browse button
|
||||||
monkeypatch.setattr(QFileDialog, "getExistingDirectory", lambda *args, **kwargs: "")
|
monkeypatch.setattr(QFileDialog, "getExistingDirectory", lambda *args, **kwargs: "")
|
||||||
assert not tabProjects._backupFolder()
|
assert not tabProjects._backupFolder()
|
||||||
|
|||||||
Reference in New Issue
Block a user