Add double space before in-line comments
This commit is contained in:
+1
-1
@@ -1961,7 +1961,7 @@ class BackgroundWordCounter(QRunnable):
|
|||||||
self._isRunning = False
|
self._isRunning = False
|
||||||
return
|
return
|
||||||
|
|
||||||
## END Class BackgroundWordCounter
|
# END Class BackgroundWordCounter
|
||||||
|
|
||||||
|
|
||||||
class BackgroundWordCounterSignals(QObject):
|
class BackgroundWordCounterSignals(QObject):
|
||||||
|
|||||||
@@ -49,6 +49,6 @@ gui_scripts =
|
|||||||
universal = 0
|
universal = 0
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E203,E221,E226,E228,E241,E251,E261
|
ignore = E203,E221,E226,E228,E241,E251
|
||||||
max-line-length = 99
|
max-line-length = 99
|
||||||
exclude = docs/*
|
exclude = docs/*
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ def testBaseConfig_Init(monkeypatch, tmpDir, fncDir, outDir, refDir, filesDir):
|
|||||||
|
|
||||||
# Let the config class figure out the path
|
# Let the config class figure out the path
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr("PyQt5.QtCore.QStandardPaths.writableLocation", lambda *args: fncDir)
|
mp.setattr("PyQt5.QtCore.QStandardPaths.writableLocation", lambda *a: fncDir)
|
||||||
tstConf.verQtValue = 50600
|
tstConf.verQtValue = 50600
|
||||||
tstConf.initConfig()
|
tstConf.initConfig()
|
||||||
assert tstConf.confPath == os.path.join(fncDir, tstConf.appHandle)
|
assert tstConf.confPath == os.path.join(fncDir, tstConf.appHandle)
|
||||||
@@ -133,7 +133,7 @@ def testBaseConfig_Init(monkeypatch, tmpDir, fncDir, outDir, refDir, filesDir):
|
|||||||
# Run again and set the paths directly and correctly
|
# Run again and set the paths directly and correctly
|
||||||
# This should create a config file as well
|
# This should create a config file as well
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr("os.path.expanduser", lambda *args: "")
|
mp.setattr("os.path.expanduser", lambda *a: "")
|
||||||
tstConf.spellTool = nwConst.SP_INTERNAL
|
tstConf.spellTool = nwConst.SP_INTERNAL
|
||||||
tstConf.initConfig(confPath=tmpDir, dataPath=tmpDir)
|
tstConf.initConfig(confPath=tmpDir, dataPath=tmpDir)
|
||||||
assert tstConf.confPath == tmpDir
|
assert tstConf.confPath == tmpDir
|
||||||
|
|||||||
@@ -86,28 +86,28 @@ def testBaseError_Handler(qtbot, monkeypatch, fncDir, tmpDir):
|
|||||||
|
|
||||||
# Normal shutdown
|
# Normal shutdown
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr(NWErrorMessage, "exec_", lambda *args: None)
|
mp.setattr(NWErrorMessage, "exec_", lambda *a: None)
|
||||||
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *args: None)
|
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *a: None)
|
||||||
exceptionHandler(Exception, "Error Message", None)
|
exceptionHandler(Exception, "Error Message", None)
|
||||||
|
|
||||||
# Should not crash when no GUI is found
|
# Should not crash when no GUI is found
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr(NWErrorMessage, "exec_", lambda *args: None)
|
mp.setattr(NWErrorMessage, "exec_", lambda *a: None)
|
||||||
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *args: None)
|
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *a: None)
|
||||||
mp.setattr("PyQt5.QtWidgets.qApp.topLevelWidgets", lambda: [])
|
mp.setattr("PyQt5.QtWidgets.qApp.topLevelWidgets", lambda: [])
|
||||||
exceptionHandler(Exception, "Error Message", None)
|
exceptionHandler(Exception, "Error Message", None)
|
||||||
|
|
||||||
# Should handle qApp failing
|
# Should handle qApp failing
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr(NWErrorMessage, "exec_", lambda *args: None)
|
mp.setattr(NWErrorMessage, "exec_", lambda *a: None)
|
||||||
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *args: None)
|
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *a: None)
|
||||||
mp.setattr("PyQt5.QtWidgets.qApp.topLevelWidgets", causeException)
|
mp.setattr("PyQt5.QtWidgets.qApp.topLevelWidgets", causeException)
|
||||||
exceptionHandler(Exception, "Error Message", None)
|
exceptionHandler(Exception, "Error Message", None)
|
||||||
|
|
||||||
# Should handle failing to close main GUI
|
# Should handle failing to close main GUI
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr(NWErrorMessage, "exec_", lambda *args: None)
|
mp.setattr(NWErrorMessage, "exec_", lambda *a: None)
|
||||||
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *args: None)
|
mp.setattr("PyQt5.QtWidgets.qApp.exit", lambda *a: None)
|
||||||
mp.setattr(nwGUI, "closeMain", causeException)
|
mp.setattr(nwGUI, "closeMain", causeException)
|
||||||
exceptionHandler(Exception, "Error Message", None)
|
exceptionHandler(Exception, "Error Message", None)
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ def testCoreDocument_LoadSave(monkeypatch, dummyGUI, nwMinimal):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.core
|
@pytest.mark.core
|
||||||
def testCoreDocument_Methods(monkeypatch, dummyGUI, nwMinimal):
|
def testCoreDocument_Methods(dummyGUI, nwMinimal):
|
||||||
"""Test other methods of the NWDoc class.
|
"""Test other methods of the NWDoc class.
|
||||||
"""
|
"""
|
||||||
theProject = NWProject(dummyGUI)
|
theProject = NWProject(dummyGUI)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ def testCoreOptions_LoadSave(monkeypatch, dummyGUI, tmpDir):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.core
|
@pytest.mark.core
|
||||||
def testCoreOptions_SetGet(monkeypatch, dummyGUI, tmpDir):
|
def testCoreOptions_SetGet(dummyGUI):
|
||||||
"""Test setting and getting values from the OptionState class.
|
"""Test setting and getting values from the OptionState class.
|
||||||
"""
|
"""
|
||||||
theProject = NWProject(dummyGUI)
|
theProject = NWProject(dummyGUI)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ from nw.constants import nwFiles
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.core
|
@pytest.mark.core
|
||||||
def testCoreProject_NewMinimal(fncDir, outDir, refDir, tmpDir, dummyGUI):
|
def testCoreProject_NewMinimal(fncDir, outDir, refDir, dummyGUI):
|
||||||
"""Create a new project from a project wizard dictionary. With
|
"""Create a new project from a project wizard dictionary. With
|
||||||
default setting, creating a Minimal project.
|
default setting, creating a Minimal project.
|
||||||
"""
|
"""
|
||||||
@@ -564,7 +564,7 @@ def testCoreProject_Helpers(monkeypatch, fncDir, dummyGUI):
|
|||||||
|
|
||||||
# Block user's home folder
|
# Block user's home folder
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr("os.path.expanduser", lambda *args, **kwargs: fncDir)
|
mp.setattr("os.path.expanduser", lambda *a, **k: fncDir)
|
||||||
assert theProject.ensureFolderStructure() is False
|
assert theProject.ensureFolderStructure() is False
|
||||||
|
|
||||||
# Create a file to block meta folder
|
# Create a file to block meta folder
|
||||||
@@ -851,7 +851,7 @@ def testCoreProject_Methods(monkeypatch, nwMinimal, dummyGUI, tmpDir):
|
|||||||
|
|
||||||
# Session stats
|
# Session stats
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr("os.path.isdir", lambda *args, **kwargs: False)
|
mp.setattr("os.path.isdir", lambda *a, **k: False)
|
||||||
assert not theProject._appendSessionStats(idleTime=0)
|
assert not theProject._appendSessionStats(idleTime=0)
|
||||||
|
|
||||||
# Block open
|
# Block open
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def testDlgAbout_Dialog(qtbot, monkeypatch, nwGUI):
|
|||||||
"""Test the full about dialogs.
|
"""Test the full about dialogs.
|
||||||
"""
|
"""
|
||||||
# NW About
|
# NW About
|
||||||
monkeypatch.setattr(GuiAbout, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiAbout, "exec_", lambda *a: None)
|
||||||
nwGUI.mainMenu.aAboutNW.activate(QAction.Trigger)
|
nwGUI.mainMenu.aAboutNW.activate(QAction.Trigger)
|
||||||
qtbot.waitUntil(lambda: getGuiItem("GuiAbout") is not None, timeout=1000)
|
qtbot.waitUntil(lambda: getGuiItem("GuiAbout") is not None, timeout=1000)
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ def testDlgAbout_Dialog(qtbot, monkeypatch, nwGUI):
|
|||||||
assert msgAbout.tabBox.currentWidget() == msgAbout.pageNotes
|
assert msgAbout.tabBox.currentWidget() == msgAbout.pageNotes
|
||||||
|
|
||||||
# Qt About
|
# Qt About
|
||||||
monkeypatch.setattr(QMessageBox, "aboutQt", lambda *args, **kwargs: None)
|
monkeypatch.setattr(QMessageBox, "aboutQt", lambda *a, **k: None)
|
||||||
nwGUI.mainMenu.aAboutQt.activate(QAction.Trigger)
|
nwGUI.mainMenu.aAboutQt.activate(QAction.Trigger)
|
||||||
|
|
||||||
# qtbot.stopForInteraction()
|
# qtbot.stopForInteraction()
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ stepDelay = 20
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
def testDlgOther_QuoteSelect(qtbot, monkeypatch, nwGUI, nwMinimal):
|
def testDlgOther_QuoteSelect(monkeypatch, nwGUI):
|
||||||
"""Test the quote symbols dialog.
|
"""Test the quote symbols dialog.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
nwQuot = GuiQuoteSelect(nwGUI)
|
nwQuot = GuiQuoteSelect(nwGUI)
|
||||||
nwQuot.show()
|
nwQuot.show()
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ stepDelay = 20
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
def testDlgItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir, outDir):
|
def testDlgItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir):
|
||||||
"""Test the full item editor dialog.
|
"""Test the full item editor dialog.
|
||||||
"""
|
"""
|
||||||
projFile = os.path.join(fncProj, "nwProject.nwx")
|
projFile = os.path.join(fncProj, "nwProject.nwx")
|
||||||
@@ -45,8 +45,8 @@ def testDlgItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir,
|
|||||||
compFile = os.path.join(refDir, "guiItemEditor_Dialog_nwProject.nwx")
|
compFile = os.path.join(refDir, "guiItemEditor_Dialog_nwProject.nwx")
|
||||||
|
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
|
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *a: True)
|
||||||
|
|
||||||
# Create new, save, open project
|
# Create new, save, open project
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
@@ -54,7 +54,7 @@ def testDlgItemEditor_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, refDir,
|
|||||||
assert nwGUI.openDocument("0e17daca5f3e1")
|
assert nwGUI.openDocument("0e17daca5f3e1")
|
||||||
assert nwGUI.treeView.setSelectedHandle("0e17daca5f3e1", doScroll=True)
|
assert nwGUI.treeView.setSelectedHandle("0e17daca5f3e1", doScroll=True)
|
||||||
|
|
||||||
monkeypatch.setattr(GuiItemEditor, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiItemEditor, "exec_", lambda *a: None)
|
||||||
nwGUI.mainMenu.aEditItem.activate(QAction.Trigger)
|
nwGUI.mainMenu.aEditItem.activate(QAction.Trigger)
|
||||||
qtbot.waitUntil(lambda: getGuiItem("GuiItemEditor") is not None, timeout=1000)
|
qtbot.waitUntil(lambda: getGuiItem("GuiItemEditor") is not None, timeout=1000)
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ stepDelay = 20
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
def testDlgMerge_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
def testDlgMerge_Main(qtbot, monkeypatch, nwGUI, fncProj):
|
||||||
"""Test the merge documents tool.
|
"""Test the merge documents tool.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
|
|||||||
"""Test the load project wizard.
|
"""Test the load project wizard.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
# Must create a clean config and GUI object as the test-wide
|
# Must create a clean config and GUI object as the test-wide
|
||||||
# nw.CONFIG object is created on import an can be tainted by other tests
|
# nw.CONFIG object is created on import an can be tainted by other tests
|
||||||
@@ -69,8 +69,8 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
|
|||||||
assert theConf.confPath == fncDir
|
assert theConf.confPath == fncDir
|
||||||
theConf.spellTool = nwConst.SP_INTERNAL
|
theConf.spellTool = nwConst.SP_INTERNAL
|
||||||
|
|
||||||
monkeypatch.setattr(GuiPreferences, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiPreferences, "exec_", lambda *a: None)
|
||||||
monkeypatch.setattr(GuiPreferences, "result", lambda *args: QDialog.Accepted)
|
monkeypatch.setattr(GuiPreferences, "result", lambda *a: QDialog.Accepted)
|
||||||
nwGUI.mainMenu.aPreferences.activate(QAction.Trigger)
|
nwGUI.mainMenu.aPreferences.activate(QAction.Trigger)
|
||||||
qtbot.waitUntil(lambda: getGuiItem("GuiPreferences") is not None, timeout=1000)
|
qtbot.waitUntil(lambda: getGuiItem("GuiPreferences") is not None, timeout=1000)
|
||||||
|
|
||||||
@@ -125,9 +125,9 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
|
|||||||
# qtbot.stopForInteraction()
|
# qtbot.stopForInteraction()
|
||||||
|
|
||||||
# Check Browse button
|
# Check Browse button
|
||||||
monkeypatch.setattr(QFileDialog, "getExistingDirectory", lambda *args, **kwargs: "")
|
monkeypatch.setattr(QFileDialog, "getExistingDirectory", lambda *a, **k: "")
|
||||||
assert not tabProjects._backupFolder()
|
assert not tabProjects._backupFolder()
|
||||||
monkeypatch.setattr(QFileDialog, "getExistingDirectory", lambda *args, **kwargs: "some/dir")
|
monkeypatch.setattr(QFileDialog, "getExistingDirectory", lambda *a, **k: "some/dir")
|
||||||
qtbot.mouseClick(tabProjects.backupGetPath, Qt.LeftButton)
|
qtbot.mouseClick(tabProjects.backupGetPath, Qt.LeftButton)
|
||||||
|
|
||||||
qtbot.wait(keyDelay)
|
qtbot.wait(keyDelay)
|
||||||
|
|||||||
@@ -48,8 +48,8 @@ def testDlgLoadProject_Main(qtbot, monkeypatch, nwGUI, nwMinimal):
|
|||||||
assert nwGUI.closeProject()
|
assert nwGUI.closeProject()
|
||||||
|
|
||||||
qtbot.wait(stepDelay)
|
qtbot.wait(stepDelay)
|
||||||
monkeypatch.setattr(GuiProjectLoad, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiProjectLoad, "exec_", lambda *a: None)
|
||||||
monkeypatch.setattr(GuiProjectLoad, "result", lambda *args: QDialog.Accepted)
|
monkeypatch.setattr(GuiProjectLoad, "result", lambda *a: QDialog.Accepted)
|
||||||
nwGUI.mainMenu.aOpenProject.activate(QAction.Trigger)
|
nwGUI.mainMenu.aOpenProject.activate(QAction.Trigger)
|
||||||
qtbot.waitUntil(lambda: getGuiItem("GuiProjectLoad") is not None, timeout=1000)
|
qtbot.waitUntil(lambda: getGuiItem("GuiProjectLoad") is not None, timeout=1000)
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ def testDlgLoadProject_Main(qtbot, monkeypatch, nwGUI, nwMinimal):
|
|||||||
assert nwLoad.listBox.topLevelItemCount() == recentCount - 1
|
assert nwLoad.listBox.topLevelItemCount() == recentCount - 1
|
||||||
|
|
||||||
getFile = os.path.join(nwMinimal, "nwProject.nwx")
|
getFile = os.path.join(nwMinimal, "nwProject.nwx")
|
||||||
monkeypatch.setattr(QFileDialog, "getOpenFileName", lambda *args, **kwargs: (getFile, None))
|
monkeypatch.setattr(QFileDialog, "getOpenFileName", lambda *a, **k: (getFile, None))
|
||||||
qtbot.mouseClick(nwLoad.browseButton, Qt.LeftButton)
|
qtbot.mouseClick(nwLoad.browseButton, Qt.LeftButton)
|
||||||
assert nwLoad.openPath == nwMinimal
|
assert nwLoad.openPath == nwMinimal
|
||||||
assert nwLoad.openState == nwLoad.OPEN_STATE
|
assert nwLoad.openState == nwLoad.OPEN_STATE
|
||||||
|
|||||||
@@ -47,8 +47,8 @@ def testDlgProjSettings_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, outDi
|
|||||||
compFile = os.path.join(refDir, "guiProjSettings_Dialog_nwProject.nwx")
|
compFile = os.path.join(refDir, "guiProjSettings_Dialog_nwProject.nwx")
|
||||||
|
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "critical", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "critical", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
# Check that we cannot open when there is no project
|
# Check that we cannot open when there is no project
|
||||||
nwGUI.mainMenu.aProjectSettings.activate(QAction.Trigger)
|
nwGUI.mainMenu.aProjectSettings.activate(QAction.Trigger)
|
||||||
@@ -64,8 +64,8 @@ def testDlgProjSettings_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, outDi
|
|||||||
nwGUI.theProject.setAutoReplace({"A": "B", "C": "D"})
|
nwGUI.theProject.setAutoReplace({"A": "B", "C": "D"})
|
||||||
|
|
||||||
# Get the dialog object
|
# Get the dialog object
|
||||||
monkeypatch.setattr(GuiProjectSettings, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiProjectSettings, "exec_", lambda *a: None)
|
||||||
monkeypatch.setattr(GuiProjectSettings, "result", lambda *args: QDialog.Accepted)
|
monkeypatch.setattr(GuiProjectSettings, "result", lambda *a: QDialog.Accepted)
|
||||||
nwGUI.mainMenu.aProjectSettings.activate(QAction.Trigger)
|
nwGUI.mainMenu.aProjectSettings.activate(QAction.Trigger)
|
||||||
qtbot.waitUntil(lambda: getGuiItem("GuiProjectSettings") is not None, timeout=1000)
|
qtbot.waitUntil(lambda: getGuiItem("GuiProjectSettings") is not None, timeout=1000)
|
||||||
|
|
||||||
@@ -135,7 +135,7 @@ def testDlgProjSettings_Dialog(qtbot, monkeypatch, nwGUI, fncDir, fncProj, outDi
|
|||||||
assert projEdit.tabStatus.listBox.topLevelItemCount() == 3
|
assert projEdit.tabStatus.listBox.topLevelItemCount() == 3
|
||||||
|
|
||||||
# Add a new item
|
# Add a new item
|
||||||
monkeypatch.setattr(QColorDialog, "getColor", lambda *args: QColor(20, 30, 40))
|
monkeypatch.setattr(QColorDialog, "getColor", lambda *a: QColor(20, 30, 40))
|
||||||
qtbot.mouseClick(projEdit.tabStatus.addButton, Qt.LeftButton)
|
qtbot.mouseClick(projEdit.tabStatus.addButton, Qt.LeftButton)
|
||||||
projEdit.tabStatus.listBox.topLevelItem(3).setSelected(True)
|
projEdit.tabStatus.listBox.topLevelItem(3).setSelected(True)
|
||||||
for n in range(8):
|
for n in range(8):
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ stepDelay = 20
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
def testDlgSplit_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
def testDlgSplit_Main(qtbot, monkeypatch, nwGUI, fncProj):
|
||||||
"""Test the split document tool.
|
"""Test the split document tool.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import pytest
|
||||||
|
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
from PyQt5.QtWidgets import QDialog, QMessageBox, QAction
|
from PyQt5.QtWidgets import QDialog, QMessageBox, QAction
|
||||||
@@ -35,14 +36,15 @@ typeDelay = 1
|
|||||||
stepDelay = 20
|
stepDelay = 20
|
||||||
|
|
||||||
|
|
||||||
def testDlgWordList_Dialog(qtbot, monkeypatch, nwGUI, nwMinimal, tmpDir):
|
@pytest.mark.gui
|
||||||
|
def testDlgWordList_Dialog(qtbot, monkeypatch, nwGUI, nwMinimal):
|
||||||
"""test the word list editor.
|
"""test the word list editor.
|
||||||
"""
|
"""
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "critical", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "critical", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(GuiWordList, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiWordList, "exec_", lambda *a: None)
|
||||||
monkeypatch.setattr(GuiWordList, "result", lambda *args: QDialog.Accepted)
|
monkeypatch.setattr(GuiWordList, "result", lambda *a: QDialog.Accepted)
|
||||||
monkeypatch.setattr(GuiWordList, "accept", lambda *args: None)
|
monkeypatch.setattr(GuiWordList, "accept", lambda *a: None)
|
||||||
|
|
||||||
# Open project
|
# Open project
|
||||||
nwGUI.openProject(nwMinimal)
|
nwGUI.openProject(nwMinimal)
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pytest
|
|
||||||
import os
|
import os
|
||||||
|
import pytest
|
||||||
|
|
||||||
from shutil import copyfile
|
from shutil import copyfile
|
||||||
from tools import cmpFiles
|
from tools import cmpFiles
|
||||||
@@ -44,12 +44,12 @@ def testGuiEditor_Main(qtbot, monkeypatch, nwGUI, fncProj, refDir, outDir):
|
|||||||
"""Test the document editor.
|
"""Test the document editor.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(GuiItemEditor, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiItemEditor, "exec_", lambda *a: None)
|
||||||
monkeypatch.setattr(GuiItemEditor, "result", lambda *args: QDialog.Accepted)
|
monkeypatch.setattr(GuiItemEditor, "result", lambda *a: QDialog.Accepted)
|
||||||
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
|
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *a: True)
|
||||||
monkeypatch.setattr(GuiDocEditor, "hasFocus", lambda *args: True)
|
monkeypatch.setattr(GuiDocEditor, "hasFocus", lambda *a: True)
|
||||||
|
|
||||||
# Create new, save, close project
|
# Create new, save, close project
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
@@ -359,8 +359,8 @@ def testGuiEditor_Search(qtbot, monkeypatch, nwGUI, nwLipsum):
|
|||||||
"""Test the document editor search functionality.
|
"""Test the document editor search functionality.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(GuiDocEditor, "hasFocus", lambda *args: True)
|
monkeypatch.setattr(GuiDocEditor, "hasFocus", lambda *a: True)
|
||||||
|
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
assert nwGUI.openProject(nwLipsum)
|
assert nwGUI.openProject(nwLipsum)
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ def testGuiViewer_Main(qtbot, monkeypatch, nwGUI, nwLipsum):
|
|||||||
"""Test the document viewer.
|
"""Test the document viewer.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
# Open project
|
# Open project
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ from PyQt5.QtWidgets import QMessageBox
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.gui
|
@pytest.mark.gui
|
||||||
def testGuiNovelTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal):
|
def testGuiNovelTree_TreeItems(qtbot, monkeypatch, nwGUI, nwMinimal):
|
||||||
"""Test navigating the novel tree.
|
"""Test navigating the novel tree.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
nwGUI.openProject(nwMinimal)
|
nwGUI.openProject(nwMinimal)
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ def testGuiOutline_Main(qtbot, monkeypatch, nwGUI, nwLipsum):
|
|||||||
"""Test the outline view.
|
"""Test the outline view.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
assert nwGUI.openProject(nwLipsum)
|
assert nwGUI.openProject(nwLipsum)
|
||||||
nwGUI.mainConf.lastPath = nwLipsum
|
nwGUI.mainConf.lastPath = nwLipsum
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ def testGuiProjDetails_Dialog(qtbot, monkeypatch, nwGUI, nwLipsum):
|
|||||||
"""Test the project details dialog.
|
"""Test the project details dialog.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "warning", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "critical", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "critical", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
# Create a project to work on
|
# Create a project to work on
|
||||||
assert nwGUI.openProject(nwLipsum)
|
assert nwGUI.openProject(nwLipsum)
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ def testGuiProjTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal):
|
|||||||
"""Test adding and removing items from the project tree.
|
"""Test adding and removing items from the project tree.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "critical", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "critical", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "warning", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(GuiMain, "editItem", lambda *args: None)
|
monkeypatch.setattr(GuiMain, "editItem", lambda *a: None)
|
||||||
|
|
||||||
nwGUI.theProject.projTree.setSeed(42)
|
nwGUI.theProject.projTree.setSeed(42)
|
||||||
nwTree = nwGUI.treeView
|
nwTree = nwGUI.treeView
|
||||||
@@ -98,12 +98,12 @@ def testGuiProjTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal):
|
|||||||
nwTree.setSelectedHandle("8c659a11cd429")
|
nwTree.setSelectedHandle("8c659a11cd429")
|
||||||
|
|
||||||
# Shift focus and try to move item
|
# Shift focus and try to move item
|
||||||
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: False)
|
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *a: False)
|
||||||
assert not nwTree.moveTreeItem(1)
|
assert not nwTree.moveTreeItem(1)
|
||||||
assert nwTree.getTreeFromHandle("a6d311a93600a") == [
|
assert nwTree.getTreeFromHandle("a6d311a93600a") == [
|
||||||
"a6d311a93600a", "f5ab3e30151e1", "8c659a11cd429", "44cb730c42048", "71ee45a3c0db9"
|
"a6d311a93600a", "f5ab3e30151e1", "8c659a11cd429", "44cb730c42048", "71ee45a3c0db9"
|
||||||
]
|
]
|
||||||
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *args: True)
|
monkeypatch.setattr(GuiProjectTree, "hasFocus", lambda *a: True)
|
||||||
|
|
||||||
# Move second item up twice (should give same result)
|
# Move second item up twice (should give same result)
|
||||||
nwGUI.mainMenu.aMoveUp.activate(QAction.Trigger)
|
nwGUI.mainMenu.aMoveUp.activate(QAction.Trigger)
|
||||||
@@ -228,7 +228,7 @@ def testGuiProjTree_TreeItems(qtbot, caplog, monkeypatch, nwGUI, nwMinimal):
|
|||||||
nwTree.clearSelection()
|
nwTree.clearSelection()
|
||||||
|
|
||||||
# Add a file with no parent, and fail to find a suitable parent item
|
# Add a file with no parent, and fail to find a suitable parent item
|
||||||
monkeypatch.setattr("nw.core.tree.NWTree.findRoot", lambda *args: None)
|
monkeypatch.setattr("nw.core.tree.NWTree.findRoot", lambda *a: None)
|
||||||
|
|
||||||
assert not nwTree.newTreeItem(nwItemType.FILE, nwItemClass.NOVEL)
|
assert not nwTree.newTreeItem(nwItemType.FILE, nwItemClass.NOVEL)
|
||||||
assert not nwTree.newTreeItem(nwItemType.FOLDER, nwItemClass.NOVEL)
|
assert not nwTree.newTreeItem(nwItemType.FOLDER, nwItemClass.NOVEL)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir):
|
|||||||
"""Test the theme and icon classes.
|
"""Test the theme and icon classes.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
nwGUI = nw.main(["--testmode", "--config=%s" % nwMinimal, "--data=%s" % tmpDir, nwMinimal])
|
nwGUI = nw.main(["--testmode", "--config=%s" % nwMinimal, "--data=%s" % tmpDir, nwMinimal])
|
||||||
qtbot.addWidget(nwGUI)
|
qtbot.addWidget(nwGUI)
|
||||||
|
|||||||
@@ -40,9 +40,9 @@ def testToolBuild_Main(qtbot, monkeypatch, nwGUI, nwLipsum, refDir, outDir):
|
|||||||
"""Test the build tool.
|
"""Test the build tool.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QFileDialog, "getSaveFileName", lambda a, b, c, **kwargs: (c, None))
|
monkeypatch.setattr(QFileDialog, "getSaveFileName", lambda a, b, c, **k: (c, None))
|
||||||
|
|
||||||
# Check that we cannot open when there is no project
|
# Check that we cannot open when there is no project
|
||||||
nwGUI.mainMenu.aBuildProject.activate(QAction.Trigger)
|
nwGUI.mainMenu.aBuildProject.activate(QAction.Trigger)
|
||||||
@@ -69,7 +69,7 @@ def testToolBuild_Main(qtbot, monkeypatch, nwGUI, nwLipsum, refDir, outDir):
|
|||||||
|
|
||||||
# Non-existent path
|
# Non-existent path
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr("os.path.expanduser", lambda *args, **kwargs: nwLipsum)
|
mp.setattr("os.path.expanduser", lambda *a, **k: nwLipsum)
|
||||||
assert nwGUI.mainConf.lastPath != nwLipsum
|
assert nwGUI.mainConf.lastPath != nwLipsum
|
||||||
nwGUI.mainConf.lastPath = "no_such_path"
|
nwGUI.mainConf.lastPath = "no_such_path"
|
||||||
assert nwBuild._saveDocument(nwBuild.FMT_NWD)
|
assert nwBuild._saveDocument(nwBuild.FMT_NWD)
|
||||||
@@ -77,7 +77,7 @@ def testToolBuild_Main(qtbot, monkeypatch, nwGUI, nwLipsum, refDir, outDir):
|
|||||||
|
|
||||||
# No path selected
|
# No path selected
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr(QFileDialog, "getSaveFileName", lambda *args, **kwargs: ("", ""))
|
mp.setattr(QFileDialog, "getSaveFileName", lambda *a, **k: ("", ""))
|
||||||
assert not nwBuild._saveDocument(nwBuild.FMT_NWD)
|
assert not nwBuild._saveDocument(nwBuild.FMT_NWD)
|
||||||
|
|
||||||
# Default Settings
|
# Default Settings
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ def testToolProjectWizard_Main(qtbot, monkeypatch, nwGUI, nwMinimal):
|
|||||||
"""Test the new project wizard.
|
"""Test the new project wizard.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "critical", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "critical", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
if sys.platform.startswith("darwin"):
|
if sys.platform.startswith("darwin"):
|
||||||
# Disable for macOS because the test segfaults on QWizard.show()
|
# Disable for macOS because the test segfaults on QWizard.show()
|
||||||
@@ -62,22 +62,22 @@ def testToolProjectWizard_Main(qtbot, monkeypatch, nwGUI, nwMinimal):
|
|||||||
# Close project, but call with invalid path
|
# Close project, but call with invalid path
|
||||||
assert nwGUI.closeProject()
|
assert nwGUI.closeProject()
|
||||||
with monkeypatch.context() as mp:
|
with monkeypatch.context() as mp:
|
||||||
mp.setattr(nwGUI, "showNewProjectDialog", lambda *args: None)
|
mp.setattr(nwGUI, "showNewProjectDialog", lambda *a: None)
|
||||||
assert not nwGUI.newProject()
|
assert not nwGUI.newProject()
|
||||||
|
|
||||||
# Now, with an empty dictionary
|
# Now, with an empty dictionary
|
||||||
mp.setattr(nwGUI, "showNewProjectDialog", lambda *args: {})
|
mp.setattr(nwGUI, "showNewProjectDialog", lambda *a: {})
|
||||||
assert not nwGUI.newProject()
|
assert not nwGUI.newProject()
|
||||||
|
|
||||||
# Now, with a non-empty folder
|
# Now, with a non-empty folder
|
||||||
mp.setattr(nwGUI, "showNewProjectDialog", lambda *args: {"projPath": nwMinimal})
|
mp.setattr(nwGUI, "showNewProjectDialog", lambda *a: {"projPath": nwMinimal})
|
||||||
assert not nwGUI.newProject()
|
assert not nwGUI.newProject()
|
||||||
|
|
||||||
##
|
##
|
||||||
# Test the Wizard
|
# Test the Wizard
|
||||||
##
|
##
|
||||||
|
|
||||||
monkeypatch.setattr(GuiProjectWizard, "exec_", lambda *args: None)
|
monkeypatch.setattr(GuiProjectWizard, "exec_", lambda *a: None)
|
||||||
nwGUI.mainConf.lastPath = " "
|
nwGUI.mainConf.lastPath = " "
|
||||||
|
|
||||||
nwGUI.closeProject()
|
nwGUI.closeProject()
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ def testToolWritingStats_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
|||||||
"""Test the full writing stats tool.
|
"""Test the full writing stats tool.
|
||||||
"""
|
"""
|
||||||
# Block message box
|
# Block message box
|
||||||
monkeypatch.setattr(QMessageBox, "question", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "question", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "information", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "information", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "warning", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "warning", lambda *a: QMessageBox.Yes)
|
||||||
monkeypatch.setattr(QMessageBox, "critical", lambda *args: QMessageBox.Yes)
|
monkeypatch.setattr(QMessageBox, "critical", lambda *a: QMessageBox.Yes)
|
||||||
|
|
||||||
# Create a project to work on
|
# Create a project to work on
|
||||||
assert nwGUI.newProject({"projPath": fncProj})
|
assert nwGUI.newProject({"projPath": fncProj})
|
||||||
@@ -116,13 +116,13 @@ def testToolWritingStats_Main(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
|||||||
sessLog.populateGUI()
|
sessLog.populateGUI()
|
||||||
|
|
||||||
# Make the saving fail
|
# Make the saving fail
|
||||||
monkeypatch.setattr(QFileDialog, "getSaveFileName", lambda *args, **kwargs: ("", ""))
|
monkeypatch.setattr(QFileDialog, "getSaveFileName", lambda *a, **k: ("", ""))
|
||||||
assert not sessLog._saveData(sessLog.FMT_CSV)
|
assert not sessLog._saveData(sessLog.FMT_CSV)
|
||||||
assert not sessLog._saveData(sessLog.FMT_JSON)
|
assert not sessLog._saveData(sessLog.FMT_JSON)
|
||||||
assert not sessLog._saveData(None)
|
assert not sessLog._saveData(None)
|
||||||
|
|
||||||
# Make the save succeed
|
# Make the save succeed
|
||||||
monkeypatch.setattr("os.path.expanduser", lambda *args: fncDir)
|
monkeypatch.setattr("os.path.expanduser", lambda *a: fncDir)
|
||||||
monkeypatch.setattr(QFileDialog, "getSaveFileName", lambda ss, tt, pp, options: (pp, ""))
|
monkeypatch.setattr(QFileDialog, "getSaveFileName", lambda ss, tt, pp, options: (pp, ""))
|
||||||
|
|
||||||
sessLog.listBox.sortByColumn(sessLog.C_TIME, 0)
|
sessLog.listBox.sortByColumn(sessLog.C_TIME, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user