Fix tests
This commit is contained in:
@@ -13,8 +13,6 @@ hidehscroll = False
|
||||
[Sizes]
|
||||
geometry = 1200, 650
|
||||
preferences = 700, 615
|
||||
treecols = 200, 50, 30
|
||||
novelcols = 200, 50
|
||||
projcols = 200, 60, 140
|
||||
mainpane = 300, 800
|
||||
docpane = 400, 400
|
||||
@@ -30,7 +28,7 @@ emphlabels = True
|
||||
[Editor]
|
||||
textfont = None
|
||||
textsize = 12
|
||||
width = 600
|
||||
width = 700
|
||||
margin = 40
|
||||
tabwidth = 40
|
||||
focuswidth = 800
|
||||
|
||||
@@ -13,8 +13,6 @@ hidehscroll = True
|
||||
[Sizes]
|
||||
geometry = 1200, 650
|
||||
preferences = 670, 589
|
||||
treecols = 200, 50, 30
|
||||
novelcols = 200, 50
|
||||
projcols = 200, 60, 140
|
||||
mainpane = 300, 800
|
||||
docpane = 400, 400
|
||||
|
||||
@@ -410,32 +410,6 @@ def testBaseConfig_SettersGetters(tmpConf, tmpDir, outDir, refDir):
|
||||
|
||||
assert tmpConf.setPreferencesSize(700, 615)
|
||||
|
||||
# Project Tree Columns
|
||||
tmpConf.guiScale = 2.0
|
||||
assert tmpConf.setTreeColWidths([10, 20, 25])
|
||||
assert tmpConf.getTreeColWidths() == [10, 20, 24]
|
||||
assert tmpConf.treeColWidth == [5, 10, 12]
|
||||
|
||||
tmpConf.guiScale = 1.0
|
||||
assert tmpConf.setTreeColWidths([10, 20, 25])
|
||||
assert tmpConf.getTreeColWidths() == [10, 20, 25]
|
||||
assert tmpConf.treeColWidth == [10, 20, 25]
|
||||
|
||||
assert tmpConf.setTreeColWidths([200, 50, 30])
|
||||
|
||||
# Novel Tree Columns
|
||||
tmpConf.guiScale = 2.0
|
||||
assert tmpConf.setNovelColWidths([10, 20])
|
||||
assert tmpConf.getNovelColWidths() == [10, 20]
|
||||
assert tmpConf.novelColWidth == [5, 10]
|
||||
|
||||
tmpConf.guiScale = 1.0
|
||||
assert tmpConf.setNovelColWidths([10, 20])
|
||||
assert tmpConf.getNovelColWidths() == [10, 20]
|
||||
assert tmpConf.novelColWidth == [10, 20]
|
||||
|
||||
assert tmpConf.setNovelColWidths([200, 50])
|
||||
|
||||
# Project Settings Tree Columns
|
||||
tmpConf.guiScale = 2.0
|
||||
assert tmpConf.setProjColWidths([10, 20, 30])
|
||||
@@ -505,13 +479,13 @@ def testBaseConfig_SettersGetters(tmpConf, tmpDir, outDir, refDir):
|
||||
# ============
|
||||
|
||||
tmpConf.guiScale = 1.0
|
||||
assert tmpConf.getTextWidth(False) == 600
|
||||
assert tmpConf.getTextWidth(False) == 700
|
||||
assert tmpConf.getTextWidth(True) == 800
|
||||
assert tmpConf.getTextMargin() == 40
|
||||
assert tmpConf.getTabWidth() == 40
|
||||
|
||||
tmpConf.guiScale = 2.0
|
||||
assert tmpConf.getTextWidth(False) == 1200
|
||||
assert tmpConf.getTextWidth(False) == 1400
|
||||
assert tmpConf.getTextWidth(True) == 1600
|
||||
assert tmpConf.getTextMargin() == 80
|
||||
assert tmpConf.getTabWidth() == 80
|
||||
|
||||
@@ -239,8 +239,8 @@ def testDlgPreferences_Main(qtbot, monkeypatch, fncDir, outDir, refDir):
|
||||
copyfile(projFile, testFile)
|
||||
ignTuple = (
|
||||
"timestamp", "guifont", "lastnotes", "guilang", "geometry",
|
||||
"preferences", "treecols", "novelcols", "projcols", "mainpane",
|
||||
"docpane", "viewpane", "outlinepane", "textfont", "textsize"
|
||||
"preferences", "projcols", "mainpane", "docpane", "viewpane",
|
||||
"outlinepane", "textfont", "textsize"
|
||||
)
|
||||
assert cmpFiles(testFile, compFile, ignoreStart=ignTuple)
|
||||
|
||||
|
||||
@@ -124,12 +124,12 @@ def testGuiNovelTree_TreeItems(qtbot, monkeypatch, nwGUI, fncProj, mockRnd):
|
||||
assert nwGUI.docViewer.docHandle() is None
|
||||
|
||||
scRect = novelTree.visualItemRect(scItem)
|
||||
oldData = scItem.data(novelTree.C_TITLE, Qt.UserRole)
|
||||
scItem.setData(novelTree.C_TITLE, Qt.UserRole, (None, "", ""))
|
||||
oldData = scItem.data(novelTree.C_TITLE, novelTree.D_HANDLE)
|
||||
scItem.setData(novelTree.C_TITLE, novelTree.D_HANDLE, None)
|
||||
qtbot.mouseClick(vPort, Qt.MiddleButton, pos=scRect.center(), delay=10)
|
||||
assert nwGUI.docViewer.docHandle() is None
|
||||
|
||||
scItem.setData(novelTree.C_TITLE, Qt.UserRole, oldData)
|
||||
scItem.setData(novelTree.C_TITLE, novelTree.D_HANDLE, oldData)
|
||||
qtbot.mouseClick(vPort, Qt.MiddleButton, pos=scRect.center(), delay=10)
|
||||
assert nwGUI.docViewer.docHandle() == "000000000000f"
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ def testGuiTheme_Main(qtbot, monkeypatch, nwMinimal, tmpDir):
|
||||
assert thePalette.window().color() == QColor(54, 54, 54)
|
||||
assert thePalette.windowText().color() == QColor(174, 174, 174)
|
||||
assert thePalette.base().color() == QColor(62, 62, 62)
|
||||
assert thePalette.alternateBase().color() == QColor(67, 67, 67)
|
||||
assert thePalette.alternateBase().color() == QColor(78, 78, 78)
|
||||
assert thePalette.text().color() == QColor(174, 174, 174)
|
||||
assert thePalette.toolTipBase().color() == QColor(255, 255, 192)
|
||||
assert thePalette.toolTipText().color() == QColor(21, 21, 13)
|
||||
|
||||
Reference in New Issue
Block a user