Remove minimal project from test suite

This commit is contained in:
Veronica Berglyd Olsen
2022-11-01 18:32:29 +01:00
parent 494b94430c
commit f1100d4475
11 changed files with 98 additions and 235 deletions
+5 -5
View File
@@ -22,7 +22,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
import pytest
import os
from tools import getGuiItem
from tools import buildTestProject, getGuiItem
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import (
@@ -33,10 +33,10 @@ from novelwriter.dialogs.projload import GuiProjectLoad
@pytest.mark.gui
def testDlgLoadProject_Main(qtbot, monkeypatch, nwGUI, nwMinimal):
def testDlgLoadProject_Main(qtbot, monkeypatch, nwGUI, fncProj):
"""Test the load project wizard.
"""
assert nwGUI.openProject(nwMinimal)
buildTestProject(nwGUI, fncProj)
assert nwGUI.closeProject()
monkeypatch.setattr(GuiProjectLoad, "exec_", lambda *a: None)
@@ -87,10 +87,10 @@ def testDlgLoadProject_Main(qtbot, monkeypatch, nwGUI, nwMinimal):
nwLoad._doDeleteRecent()
assert nwLoad.listBox.topLevelItemCount() == recentCount - 1
getFile = os.path.join(nwMinimal, "nwProject.nwx")
getFile = os.path.join(fncProj, "nwProject.nwx")
monkeypatch.setattr(QFileDialog, "getOpenFileName", lambda *a, **k: (getFile, None))
qtbot.mouseClick(nwLoad.browseButton, Qt.LeftButton)
assert nwLoad.openPath == nwMinimal
assert nwLoad.openPath == fncProj
assert nwLoad.openState == nwLoad.OPEN_STATE
nwLoad.close()
+6 -4
View File
@@ -25,7 +25,7 @@ import pytest
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialog, QAction
from tools import writeFile, readFile, getGuiItem
from tools import buildTestProject, writeFile, readFile, getGuiItem
from mock import causeOSError
from novelwriter.constants import nwFiles
@@ -33,16 +33,18 @@ from novelwriter.dialogs.wordlist import GuiWordList
@pytest.mark.gui
def testDlgWordList_Dialog(qtbot, monkeypatch, nwGUI, nwMinimal):
def testDlgWordList_Dialog(qtbot, monkeypatch, nwGUI, fncProj):
"""test the word list editor.
"""
buildTestProject(nwGUI, fncProj)
monkeypatch.setattr(GuiWordList, "exec_", lambda *a: None)
monkeypatch.setattr(GuiWordList, "result", lambda *a: QDialog.Accepted)
monkeypatch.setattr(GuiWordList, "accept", lambda *a: None)
# Open project
nwGUI.openProject(nwMinimal)
dictFile = os.path.join(nwMinimal, "meta", nwFiles.PROJ_DICT)
nwGUI.openProject(fncProj)
dictFile = os.path.join(fncProj, "meta", nwFiles.PROJ_DICT)
# Load the dialog
nwGUI.mainMenu.aEditWordList.activate(QAction.Trigger)