Make tests not depend on minimal project settings

This commit is contained in:
Veronica Berglyd Olsen
2022-05-21 17:33:58 +02:00
parent b4ea5bc8d0
commit 06d39ea352
18 changed files with 124 additions and 67 deletions
+5 -3
View File
@@ -22,6 +22,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
import pytest
import os
from tools import buildTestProject
from PyQt5.QtWidgets import QAction, QMessageBox
from novelwriter.guimain import GuiMain
@@ -47,7 +49,7 @@ def testGuiProjTree_NewItems(qtbot, caplog, monkeypatch, nwGUI, fncDir, mockRnd)
# Create a project
prjDir = os.path.join(fncDir, "project")
assert nwGUI.newProject({"projPath": prjDir}) is True
buildTestProject(nwGUI, prjDir)
# No itemType set
nwTree.clearSelection()
@@ -155,7 +157,7 @@ def testGuiProjTree_MoveItems(qtbot, monkeypatch, nwGUI, fncDir, mockRnd):
# Create a project
prjDir = os.path.join(fncDir, "project")
assert nwGUI.newProject({"projPath": prjDir}) is True
buildTestProject(nwGUI, prjDir)
# Move Documents
# ==============
@@ -283,7 +285,7 @@ def testGuiProjTree_DeleteItems(qtbot, caplog, monkeypatch, nwGUI, fncDir, mockR
# Create a project
prjDir = os.path.join(fncDir, "project")
assert nwGUI.newProject({"projPath": prjDir}) is True
buildTestProject(nwGUI, prjDir)
# Try emptying the trash already now, when there is no trash folder
assert nwTree.emptyTrash() is False