Merge release 2.4.3 into main
This commit is contained in:
@@ -37,7 +37,9 @@ from tests.mocked import causeException
|
||||
@pytest.mark.gui
|
||||
def testToolDictionaries_Main(qtbot, monkeypatch, nwGUI, fncPath):
|
||||
"""Test the Dictionaries downloader tool."""
|
||||
monkeypatch.setattr(enchant, "get_user_config_dir", lambda *a: str(fncPath))
|
||||
# Must also create the enchant folder, see issue #1874
|
||||
enchPath = fncPath / "enchant"
|
||||
monkeypatch.setattr(enchant, "get_user_config_dir", lambda *a: str(enchPath))
|
||||
|
||||
# Fail to open
|
||||
with monkeypatch.context() as mp:
|
||||
@@ -52,7 +54,7 @@ def testToolDictionaries_Main(qtbot, monkeypatch, nwGUI, fncPath):
|
||||
nwDicts = SHARED.findTopLevelWidget(GuiDictionaries)
|
||||
assert isinstance(nwDicts, GuiDictionaries)
|
||||
assert nwDicts.isVisible()
|
||||
assert nwDicts.inPath.text() == str(fncPath)
|
||||
assert nwDicts.inPath.text() == str(enchPath)
|
||||
|
||||
# Allow Open Dir
|
||||
SHARED._lastAlert = ""
|
||||
@@ -98,9 +100,9 @@ def testToolDictionaries_Main(qtbot, monkeypatch, nwGUI, fncPath):
|
||||
nwDicts._doBrowseHunspell()
|
||||
assert nwDicts.huInput.text() == str(foDict)
|
||||
nwDicts._doImportHunspell()
|
||||
assert (fncPath / "hunspell").is_dir()
|
||||
assert (fncPath / "hunspell" / "en_GB.aff").is_file()
|
||||
assert (fncPath / "hunspell" / "en_GB.dic").is_file()
|
||||
assert (enchPath / "hunspell").is_dir()
|
||||
assert (enchPath / "hunspell" / "en_GB.aff").is_file()
|
||||
assert (enchPath / "hunspell" / "en_GB.dic").is_file()
|
||||
assert nwDicts.infoBox.blockCount() == 3
|
||||
|
||||
# Import Libre Office Dictionary
|
||||
@@ -109,9 +111,9 @@ def testToolDictionaries_Main(qtbot, monkeypatch, nwGUI, fncPath):
|
||||
nwDicts._doBrowseHunspell()
|
||||
assert nwDicts.huInput.text() == str(loDict)
|
||||
nwDicts._doImportHunspell()
|
||||
assert (fncPath / "hunspell").is_dir()
|
||||
assert (fncPath / "hunspell" / "en_US.aff").is_file()
|
||||
assert (fncPath / "hunspell" / "en_US.dic").is_file()
|
||||
assert (enchPath / "hunspell").is_dir()
|
||||
assert (enchPath / "hunspell" / "en_US.aff").is_file()
|
||||
assert (enchPath / "hunspell" / "en_US.dic").is_file()
|
||||
assert nwDicts.infoBox.blockCount() == 5
|
||||
|
||||
# Handle Unreadable File
|
||||
|
||||
Reference in New Issue
Block a user