Split up the storage of quote symbols in config

This commit is contained in:
Veronica Berglyd Olsen
2022-11-11 12:50:36 +01:00
parent 6a664037cf
commit b05028e3c9
8 changed files with 85 additions and 65 deletions
+5 -3
View File
@@ -1,5 +1,5 @@
[Meta]
timestamp = 2022-11-10 11:10:10
timestamp = 2022-11-11 12:48:18
[Main]
theme = default
@@ -46,8 +46,10 @@ repdots = True
scrollpastend = 25
autoscroll = False
autoscrollpos = 30
fmtsinglequote = ,
fmtdoublequote = “, ”
fmtsquoteopen =
fmtsquoteclose =
fmtdquoteopen = “
fmtdquoteclose = ”
fmtpadbefore =
fmtpadafter =
fmtpadthin = False
@@ -1,5 +1,5 @@
[Meta]
timestamp = 2022-11-10 11:10:13
timestamp = 2022-11-11 12:48:20
[Main]
theme = default
@@ -46,8 +46,10 @@ repdots = True
scrollpastend = 0
autoscroll = True
autoscrollpos = 30
fmtsinglequote = ,
fmtdoublequote = “, ”
fmtsquoteopen =
fmtsquoteclose =
fmtdquoteopen = “
fmtdquoteclose = ”
fmtpadbefore =
fmtpadafter =
fmtpadthin = False
+4 -2
View File
@@ -141,8 +141,10 @@ def testBaseConfig_InitLoadSave(monkeypatch, fncPath, tstPaths):
assert newConf.guiSyntax == "bar"
# Test Correcting Quote Settings
tstConf.fmtDoubleQuotes = ["\"", "\""]
tstConf.fmtSingleQuotes = ["'", "'"]
tstConf.fmtDQuoteOpen = "\""
tstConf.fmtDQuoteClose = "\""
tstConf.fmtSQuoteOpen = "'"
tstConf.fmtSQuoteClose = "'"
tstConf.doReplaceDQuote = True
tstConf.doReplaceSQuote = True
assert tstConf.saveConfig() is True
+4 -4
View File
@@ -461,19 +461,19 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncPath, projPath, mockRnd):
nwGUI.docEditor.clear()
nwGUI.mainMenu.aInsQuoteLS.activate(QAction.Trigger)
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtSingleQuotes[0]
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtSQuoteOpen
nwGUI.docEditor.clear()
nwGUI.mainMenu.aInsQuoteRS.activate(QAction.Trigger)
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtSingleQuotes[1]
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtSQuoteClose
nwGUI.docEditor.clear()
nwGUI.mainMenu.aInsQuoteLD.activate(QAction.Trigger)
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtDoubleQuotes[0]
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtDQuoteOpen
nwGUI.docEditor.clear()
nwGUI.mainMenu.aInsQuoteRD.activate(QAction.Trigger)
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtDoubleQuotes[1]
assert nwGUI.docEditor.getText() == nwGUI.mainConf.fmtDQuoteClose
nwGUI.docEditor.clear()
nwGUI.mainMenu.aInsMSApos.activate(QAction.Trigger)