Project tree status and total word count changes (#882)
* Fix some inconsistencies in source file docstrings * Remove the option to show status text in project tree * Change how total word counts are calculated and propagated * Fix tests and improve coverage * Add setting in preferences * Add missing word count timer to config file
This commit is contained in:
committed by
GitHub
parent
b9311e84ce
commit
3c8cb34b0a
@@ -482,6 +482,7 @@ def testBaseCommon_NWConfigParser(fncDir):
|
||||
"boolopt4 = 0\n"
|
||||
"list1 = a, b, c\n"
|
||||
"list2 = 17, 18, 19\n"
|
||||
"float1 = 4.2\n"
|
||||
))
|
||||
|
||||
cfgParser = NWConfigParser()
|
||||
@@ -516,6 +517,14 @@ def testBaseCommon_NWConfigParser(fncDir):
|
||||
assert cfgParser.rdInt("nope", "intopt1", 13) == 13
|
||||
assert cfgParser.rdInt("main", "blabla", 13) == 13
|
||||
|
||||
# Read Float
|
||||
assert cfgParser.rdFlt("main", "intopt1", 13.0) == 42.0
|
||||
assert cfgParser.rdFlt("main", "float1", 13.0) == 4.2
|
||||
assert cfgParser.rdInt("main", "stropt", 13.0) == 13.0
|
||||
|
||||
assert cfgParser.rdInt("nope", "intopt1", 13.0) == 13.0
|
||||
assert cfgParser.rdInt("main", "blabla", 13.0) == 13.0
|
||||
|
||||
# Read String List
|
||||
assert cfgParser.rdStrList("main", "list1", []) == []
|
||||
assert cfgParser.rdStrList("main", "list1", ["x"]) == ["a"]
|
||||
|
||||
@@ -519,24 +519,24 @@ def testBaseConfig_SettersGetters(tmpConf, tmpDir, outDir, refDir):
|
||||
# Flag Setters
|
||||
# ============
|
||||
|
||||
assert not tmpConf.setShowRefPanel(False)
|
||||
assert not tmpConf.showRefPanel
|
||||
assert tmpConf.setShowRefPanel(True)
|
||||
assert tmpConf.setShowRefPanel(False) is False
|
||||
assert tmpConf.showRefPanel is False
|
||||
assert tmpConf.setShowRefPanel(True) is True
|
||||
|
||||
assert not tmpConf.setViewComments(False)
|
||||
assert not tmpConf.viewComments
|
||||
assert tmpConf.setViewComments(True)
|
||||
assert tmpConf.setViewComments(False) is False
|
||||
assert tmpConf.viewComments is False
|
||||
assert tmpConf.setViewComments(True) is True
|
||||
|
||||
assert not tmpConf.setViewSynopsis(False)
|
||||
assert not tmpConf.viewSynopsis
|
||||
assert tmpConf.setViewSynopsis(True)
|
||||
assert tmpConf.setViewSynopsis(False) is False
|
||||
assert tmpConf.viewSynopsis is False
|
||||
assert tmpConf.setViewSynopsis(True) is True
|
||||
|
||||
# Check Final File
|
||||
# ================
|
||||
|
||||
assert tmpConf.confChanged
|
||||
assert tmpConf.saveConfig()
|
||||
assert not tmpConf.confChanged
|
||||
assert tmpConf.confChanged is True
|
||||
assert tmpConf.saveConfig() is True
|
||||
assert tmpConf.confChanged is False
|
||||
|
||||
copyfile(confFile, testFile)
|
||||
assert cmpFiles(testFile, compFile, [2, 9, 10])
|
||||
|
||||
Reference in New Issue
Block a user