Clean up variables and formatting
This commit is contained in:
@@ -177,19 +177,19 @@ def testBaseConfig_Localisation(fncPath, tstPaths):
|
||||
tstConf.initLocalisation(tstApp) # type: ignore
|
||||
|
||||
# Check Lists
|
||||
theList = tstConf.listLanguages(tstConf.LANG_NW)
|
||||
assert theList == [("en_GB", "British English")]
|
||||
theList = tstConf.listLanguages(tstConf.LANG_PROJ)
|
||||
assert theList == [("en_GB", "British English")]
|
||||
theList = tstConf.listLanguages(None) # type: ignore
|
||||
assert theList == []
|
||||
languages = tstConf.listLanguages(tstConf.LANG_NW)
|
||||
assert languages == [("en_GB", "British English")]
|
||||
languages = tstConf.listLanguages(tstConf.LANG_PROJ)
|
||||
assert languages == [("en_GB", "British English")]
|
||||
languages = tstConf.listLanguages(None) # type: ignore
|
||||
assert languages == []
|
||||
|
||||
# Add Language
|
||||
copyfile(tstPaths.filesDir / "nw_en_GB.qm", i18nDir / "nw_fr.qm")
|
||||
writeFile(i18nDir / "nw_fr.ts", "")
|
||||
|
||||
theList = tstConf.listLanguages(tstConf.LANG_NW)
|
||||
assert theList == [("en_GB", "British English"), ("fr", "Français")]
|
||||
languages = tstConf.listLanguages(tstConf.LANG_NW)
|
||||
assert languages == [("en_GB", "British English"), ("fr", "Français")]
|
||||
|
||||
# END Test testBaseConfig_Localisation
|
||||
|
||||
|
||||
@@ -43,19 +43,19 @@ def testBaseError_Dialog(qtbot, monkeypatch, nwGUI):
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr("PyQt5.QtCore.QSysInfo.kernelVersion", lambda: "1.2.3")
|
||||
nwErr.setMessage(Exception, "Fine Error", None)
|
||||
theMessage = nwErr.msgBody.toPlainText()
|
||||
assert theMessage != ""
|
||||
assert "Fine Error" in theMessage
|
||||
assert "Exception" in theMessage
|
||||
assert "(1.2.3)" in theMessage
|
||||
message = nwErr.msgBody.toPlainText()
|
||||
assert message != ""
|
||||
assert "Fine Error" in message
|
||||
assert "Exception" in message
|
||||
assert "(1.2.3)" in message
|
||||
|
||||
# No kernel version retrieved
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr("PyQt5.QtCore.QSysInfo.kernelVersion", causeException)
|
||||
nwErr.setMessage(Exception, "Almost Fine Error", None)
|
||||
theMessage = nwErr.msgBody.toPlainText()
|
||||
assert theMessage != ""
|
||||
assert "(Unknown)" in theMessage
|
||||
message = nwErr.msgBody.toPlainText()
|
||||
assert message != ""
|
||||
assert "(Unknown)" in message
|
||||
|
||||
nwErr._doClose()
|
||||
nwErr.close()
|
||||
|
||||
Reference in New Issue
Block a user