From dcb473137b4bf61976bc83de09afb11dc4b3a625 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sat, 29 Oct 2022 01:26:58 +0200 Subject: [PATCH] Update documentation and test with synopsis insert feature --- docs/source/usage_shortcuts.rst | 1 + tests/test_gui/test_gui_mainmenu.py | 27 +++++++++++++++------------ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/docs/source/usage_shortcuts.rst b/docs/source/usage_shortcuts.rst index 7a321bcc..8254dfe0 100644 --- a/docs/source/usage_shortcuts.rst +++ b/docs/source/usage_shortcuts.rst @@ -137,6 +137,7 @@ a key or key combination for the inserted content. ":kbd:`Ctrl`:kbd:`K`, :kbd:`F`", "Insert a ``@focus`` keyword." ":kbd:`Ctrl`:kbd:`K`, :kbd:`C`", "Insert a ``@char`` keyword." ":kbd:`Ctrl`:kbd:`K`, :kbd:`P`", "Insert a ``@plot`` keyword." + ":kbd:`Ctrl`:kbd:`K`, :kbd:`S`", "Insert a synopsis comment." ":kbd:`Ctrl`:kbd:`K`, :kbd:`T`", "Insert a ``@time`` keyword." ":kbd:`Ctrl`:kbd:`K`, :kbd:`L`", "Insert a ``@location`` keyword." ":kbd:`Ctrl`:kbd:`K`, :kbd:`O`", "Insert an ``@object`` keyword." diff --git a/tests/test_gui/test_gui_mainmenu.py b/tests/test_gui/test_gui_mainmenu.py index f10514ad..7d7caaf7 100644 --- a/tests/test_gui/test_gui_mainmenu.py +++ b/tests/test_gui/test_gui_mainmenu.py @@ -537,9 +537,8 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj, mockRnd): assert nwGUI.docEditor.getText() == nwUnicode.U_THNBSP nwGUI.docEditor.clear() - ## - # Insert Keywords - ## + # Insert Keywords + # =============== nwGUI.docEditor.setText("Stuff") nwGUI.mainMenu.mInsKWItems[nwKeyWords.TAG_KEY][0].activate(QAction.Trigger) @@ -589,9 +588,15 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj, mockRnd): nwGUI.docEditor.clear() - ## - # Insert Break or Space - ## + # Insert Special Comments + # ======================= + + nwGUI.docEditor.setText("Stuff\n") + nwGUI.mainMenu.aInsSynopsis.activate(QAction.Trigger) + assert nwGUI.docEditor.getText() == "Stuff\n% Synopsis: \n" + + # Insert Break or Space + # ===================== nwGUI.docEditor.setText("### Stuff\n") nwGUI.mainMenu.aInsNewPage.activate(QAction.Trigger) @@ -607,9 +612,8 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj, mockRnd): nwGUI.docEditor.clear() - ## - # Insert text from file - ## + # Insert Text from File + # ===================== nwGUI.closeDocument() @@ -645,9 +649,8 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj, mockRnd): nwGUI.mainMenu.aImportFile.activate(QAction.Trigger) assert nwGUI.docEditor.getText() == "Foo" - ## - # Reveal file location - ## + # Reveal File Location + # ==================== theMessage = ""