Add coverage to remaining missed lines

This commit is contained in:
Veronica Berglyd Olsen
2024-11-25 00:07:32 +01:00
parent e30d2cbbf1
commit 4cadd1597e
8 changed files with 199 additions and 44 deletions
+11
View File
@@ -702,6 +702,17 @@ def testGuiMain_Viewing(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
nwGUI.viewDocument(C.hSceneDoc)
assert nwGUI.docViewer.toPlainText() == "New Scene\nWith some stuff in it!"
# Open with keypress
nwGUI.closeDocViewer()
assert nwGUI.docViewer.docHandle is None
nwGUI.projView.setSelectedHandle(C.hSceneDoc)
with monkeypatch.context() as mp:
mp.setattr(nwGUI.projView.projTree, "hasFocus", lambda *a: True)
qtbot.keyClick(
nwGUI.projView.projTree, Qt.Key.Key_Return, modifier=QtModShift, delay=KEY_DELAY
)
assert nwGUI.docViewer.docHandle == C.hSceneDoc
# qtbot.stop()