Make project instance private to main GUI class
This commit is contained in:
@@ -35,7 +35,7 @@ def testDlgSplit_Main(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
||||
# Create a new project
|
||||
buildTestProject(nwGUI, projPath)
|
||||
|
||||
theProject = nwGUI.theProject
|
||||
theProject = nwGUI.project
|
||||
projTree = nwGUI.projView.projTree
|
||||
|
||||
docText = (
|
||||
|
||||
@@ -54,7 +54,7 @@ def testDlgProjDetails_Dialog(qtbot, nwGUI, prjLipsum):
|
||||
assert projDet.tabMain.wordCountVal.text() == f"{3000:n}"
|
||||
assert projDet.tabMain.chapCountVal.text() == f"{3:n}"
|
||||
assert projDet.tabMain.sceneCountVal.text() == f"{5:n}"
|
||||
assert projDet.tabMain.revCountVal.text() == f"{nwGUI.theProject.data.saveCount:n}"
|
||||
assert projDet.tabMain.revCountVal.text() == f"{nwGUI.project.data.saveCount:n}"
|
||||
|
||||
assert projDet.tabMain.projPathVal.text() == str(prjLipsum)
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ def testDlgProjSettings_Dialog(qtbot, monkeypatch, nwGUI):
|
||||
|
||||
# Pretend we have a project
|
||||
nwGUI.hasProject = True
|
||||
nwGUI.theProject.data.setSpellLang("en")
|
||||
nwGUI.project.data.setSpellLang("en")
|
||||
|
||||
# Get the dialog object
|
||||
nwGUI.mainMenu.aProjectSettings.activate(QAction.Trigger)
|
||||
@@ -95,7 +95,7 @@ def testDlgProjSettings_Main(qtbot, monkeypatch, nwGUI, fncPath, projPath, mockR
|
||||
CONFIG.setBackupPath(fncPath)
|
||||
|
||||
# Set some values
|
||||
theProject = nwGUI.theProject
|
||||
theProject = nwGUI.project
|
||||
theProject.data.setSpellLang("en")
|
||||
theProject.data.setAuthor("Jane Smith")
|
||||
theProject.data.setAutoReplace({"A": "B", "C": "D"})
|
||||
@@ -160,7 +160,7 @@ def testDlgProjSettings_StatusImport(qtbot, monkeypatch, nwGUI, fncPath, projPat
|
||||
CONFIG.setBackupPath(fncPath)
|
||||
|
||||
# Set some values
|
||||
theProject = nwGUI.theProject
|
||||
theProject = nwGUI.project
|
||||
theProject.tree[C.hTitlePage].setStatus(C.sFinished)
|
||||
theProject.tree[C.hChapterDoc].setStatus(C.sDraft)
|
||||
theProject.tree[C.hSceneDoc].setStatus(C.sDraft)
|
||||
@@ -361,7 +361,7 @@ def testDlgProjSettings_Replace(qtbot, monkeypatch, nwGUI, fncPath, projPath, mo
|
||||
CONFIG.setBackupPath(fncPath)
|
||||
|
||||
# Set some values
|
||||
theProject = nwGUI.theProject
|
||||
theProject = nwGUI.project
|
||||
theProject.data.setAutoReplace({
|
||||
"A": "B", "C": "D"
|
||||
})
|
||||
|
||||
@@ -55,7 +55,7 @@ def testDlgWordList_Dialog(qtbot, monkeypatch, nwGUI, projPath):
|
||||
assert wList.listBox.count() == 0
|
||||
|
||||
# Add words
|
||||
userDict = UserDictionary(nwGUI.theProject)
|
||||
userDict = UserDictionary(nwGUI.project)
|
||||
userDict.add("word_a")
|
||||
userDict.add("word_c")
|
||||
userDict.add("word_g")
|
||||
|
||||
Reference in New Issue
Block a user