Connect the splash screen and add messages to track progress

This commit is contained in:
Veronica Berglyd Olsen
2025-04-25 18:41:28 +02:00
parent dc6259133f
commit 9c8030e588
6 changed files with 81 additions and 16 deletions
+6
View File
@@ -33,6 +33,7 @@ from novelwriter import (
BLUE, CONFIG, END, FILE, LINE, LVLC, LVLP, TEXT, TIME, WHITE, _createApp,
logger, main
)
from novelwriter.splash import NSplashScreen
from tests.tools import clearLogHandlers
@@ -40,6 +41,8 @@ from tests.tools import clearLogHandlers
@pytest.mark.base
def testBaseInit_Launch(caplog, monkeypatch, fncPath):
"""Check launching the main GUI. This test """
monkeypatch.setattr(NSplashScreen, "finish", lambda *a: None)
monkeypatch.setattr("novelwriter.splash.sleep", lambda *a: None)
monkeypatch.setattr("novelwriter._createApp", lambda *a: Mock())
monkeypatch.setattr("novelwriter.guimain.GuiMain", Mock())
monkeypatch.setattr(sys, "exit", Mock())
@@ -77,6 +80,9 @@ def testBaseInit_CreateApp(caplog, monkeypatch, fncPath):
@pytest.mark.base
def testBaseInit_Options(monkeypatch, fncPath):
"""Test command line options for logging level."""
monkeypatch.setattr(NSplashScreen, "finish", lambda *a: None)
monkeypatch.setattr("novelwriter.splash.sleep", lambda *a: None)
gui = Mock()
app = Mock()
app.exec = Mock(return_value=0)