Fix broken tests
This commit is contained in:
@@ -65,6 +65,9 @@ class MockTheme:
|
|||||||
self.guiFontBU = QFont()
|
self.guiFontBU = QFont()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def initThemes(self) -> None:
|
||||||
|
return
|
||||||
|
|
||||||
def getPixmap(self, *a) -> QPixmap:
|
def getPixmap(self, *a) -> QPixmap:
|
||||||
return QPixmap()
|
return QPixmap()
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ from novelwriter.config import DEF_GUI_DARK, DEF_GUI_LIGHT
|
|||||||
from novelwriter.constants import nwUnicode
|
from novelwriter.constants import nwUnicode
|
||||||
from novelwriter.dialogs.preferences import GuiPreferences
|
from novelwriter.dialogs.preferences import GuiPreferences
|
||||||
from novelwriter.dialogs.quotes import GuiQuoteSelect
|
from novelwriter.dialogs.quotes import GuiQuoteSelect
|
||||||
|
from novelwriter.gui.theme import ThemeEntry
|
||||||
from novelwriter.types import QtDialogCancel, QtDialogSave, QtModNone
|
from novelwriter.types import QtDialogCancel, QtDialogSave, QtModNone
|
||||||
|
|
||||||
KEY_DELAY = 1
|
KEY_DELAY = 1
|
||||||
@@ -147,12 +148,12 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths):
|
|||||||
(fncPath / "nw_en_US.qm").touch()
|
(fncPath / "nw_en_US.qm").touch()
|
||||||
(fncPath / "project_en_US.json").touch()
|
(fncPath / "project_en_US.json").touch()
|
||||||
CONFIG._nwLangPath = fncPath
|
CONFIG._nwLangPath = fncPath
|
||||||
SHARED.theme._themeList = [
|
SHARED.theme._allThemes = {
|
||||||
("theme1", "Theme 1", False),
|
"theme1": ThemeEntry(name="Theme 1", dark=False, path=fncPath),
|
||||||
("theme2", "Theme 2", False),
|
"theme2": ThemeEntry(name="Theme 2", dark=False, path=fncPath),
|
||||||
("theme3", "Theme 3", True),
|
"theme3": ThemeEntry(name="Theme 3", dark=True, path=fncPath),
|
||||||
("theme4", "Theme 4", True),
|
"theme4": ThemeEntry(name="Theme 4", dark=True, path=fncPath),
|
||||||
]
|
}
|
||||||
|
|
||||||
prefs = GuiPreferences(nwGUI)
|
prefs = GuiPreferences(nwGUI)
|
||||||
with qtbot.waitExposed(prefs):
|
with qtbot.waitExposed(prefs):
|
||||||
|
|||||||
Reference in New Issue
Block a user