Make tests not depend on minimal project settings
This commit is contained in:
@@ -21,7 +21,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import pytest
|
||||
|
||||
from tools import getGuiItem
|
||||
from tools import getGuiItem, buildTestProject
|
||||
|
||||
from PyQt5.QtWidgets import QAction, QMessageBox
|
||||
|
||||
@@ -40,7 +40,7 @@ def testToolLipsum_Main(qtbot, monkeypatch, nwGUI, fncProj, mockRnd):
|
||||
assert getGuiItem("GuiLipsum") is None
|
||||
|
||||
# Create a new project
|
||||
assert nwGUI.newProject({"projPath": fncProj}) is True
|
||||
buildTestProject(nwGUI, fncProj)
|
||||
assert nwGUI.openDocument("000000000000f") is True
|
||||
assert len(nwGUI.docEditor.getText()) == 15
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ import pytest
|
||||
import json
|
||||
import os
|
||||
|
||||
from tools import getGuiItem, writeFile
|
||||
from mock import causeOSError
|
||||
from tools import getGuiItem, writeFile, buildTestProject
|
||||
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtWidgets import QAction, QFileDialog, QMessageBox
|
||||
@@ -48,7 +48,7 @@ def testToolWritingStats_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
||||
monkeypatch.setattr(QMessageBox, "critical", lambda *a: QMessageBox.Yes)
|
||||
|
||||
# Create a project to work on
|
||||
assert nwGUI.newProject({"projPath": fncProj})
|
||||
buildTestProject(nwGUI, fncProj)
|
||||
qtbot.wait(100)
|
||||
assert nwGUI.saveProject()
|
||||
sessFile = os.path.join(fncProj, "meta", nwFiles.SESS_STATS)
|
||||
|
||||
Reference in New Issue
Block a user