Rename the access metods of the item class from exported to active
This commit is contained in:
@@ -524,7 +524,7 @@ def testCoreIndex_ExtractData(mockGUI, fncDir, mockRnd):
|
||||
]
|
||||
|
||||
# Check that excluded files can be skipped
|
||||
theProject.tree[nHandle].setExported(False)
|
||||
theProject.tree[nHandle].setActive(False)
|
||||
|
||||
theKeys = []
|
||||
for aKey, _, _, _ in theIndex.novelStructure(skipExcl=False):
|
||||
@@ -1072,7 +1072,7 @@ def testCoreIndex_ItemIndex(mockGUI, fncDir, mockRnd):
|
||||
assert nStruct[3][0] == uHandle
|
||||
|
||||
# Skip excluded
|
||||
theProject.tree[sHandle].setExported(False)
|
||||
theProject.tree[sHandle].setActive(False)
|
||||
nStruct = list(itemIndex.iterNovelStructure(skipExcl=True))
|
||||
assert len(nStruct) == 3
|
||||
assert nStruct[0][0] == nHandle
|
||||
|
||||
@@ -136,18 +136,18 @@ def testCoreItem_Setters(mockGUI, mockRnd):
|
||||
assert theItem.isExpanded is True
|
||||
|
||||
# Exported
|
||||
theItem.setExported(8)
|
||||
assert theItem.isExported is False
|
||||
theItem.setExported(None)
|
||||
assert theItem.isExported is False
|
||||
theItem.setExported("None")
|
||||
assert theItem.isExported is False
|
||||
theItem.setExported("What?")
|
||||
assert theItem.isExported is False
|
||||
theItem.setExported("True")
|
||||
assert theItem.isExported is True
|
||||
theItem.setExported(True)
|
||||
assert theItem.isExported is True
|
||||
theItem.setActive(8)
|
||||
assert theItem.isActive is False
|
||||
theItem.setActive(None)
|
||||
assert theItem.isActive is False
|
||||
theItem.setActive("None")
|
||||
assert theItem.isActive is False
|
||||
theItem.setActive("What?")
|
||||
assert theItem.isActive is False
|
||||
theItem.setActive("True")
|
||||
assert theItem.isActive is True
|
||||
theItem.setActive(True)
|
||||
assert theItem.isActive is True
|
||||
|
||||
# CharCount
|
||||
theItem.setCharCount(None)
|
||||
@@ -513,7 +513,7 @@ def testCoreItem_XMLPackUnpack(mockGUI, caplog, mockRnd):
|
||||
theItem.setType("FILE")
|
||||
theItem.setImport(importKeys[3])
|
||||
theItem.setLayout("NOTE")
|
||||
theItem.setExported(False)
|
||||
theItem.setActive(False)
|
||||
theItem.setParaCount(3)
|
||||
theItem.setWordCount(5)
|
||||
theItem.setCharCount(7)
|
||||
@@ -538,7 +538,7 @@ def testCoreItem_XMLPackUnpack(mockGUI, caplog, mockRnd):
|
||||
assert theItem.itemParent == "0123456789abc"
|
||||
assert theItem.itemRoot == "0123456789abc"
|
||||
assert theItem.itemOrder == 1
|
||||
assert theItem.isExported is False
|
||||
assert theItem.isActive is False
|
||||
assert theItem.paraCount == 3
|
||||
assert theItem.wordCount == 5
|
||||
assert theItem.charCount == 7
|
||||
@@ -563,7 +563,7 @@ def testCoreItem_XMLPackUnpack(mockGUI, caplog, mockRnd):
|
||||
theItem.setStatus(statusKeys[1])
|
||||
theItem.setLayout("NOTE")
|
||||
theItem.setExpanded(True)
|
||||
theItem.setExported(False)
|
||||
theItem.setActive(False)
|
||||
theItem.setParaCount(3)
|
||||
theItem.setWordCount(5)
|
||||
theItem.setCharCount(7)
|
||||
@@ -588,7 +588,7 @@ def testCoreItem_XMLPackUnpack(mockGUI, caplog, mockRnd):
|
||||
assert theItem.itemRoot == "0123456789abc"
|
||||
assert theItem.itemOrder == 1
|
||||
assert theItem.isExpanded is True
|
||||
assert theItem.isExported is True
|
||||
assert theItem.isActive is True
|
||||
assert theItem.paraCount == 0
|
||||
assert theItem.wordCount == 0
|
||||
assert theItem.charCount == 0
|
||||
@@ -695,7 +695,7 @@ def testCoreItem_ConvertFromFmt13(mockGUI):
|
||||
assert theItem.itemParent == "b000000000001"
|
||||
assert theItem.itemOrder == 1
|
||||
assert theItem.isExpanded is True
|
||||
assert theItem.isExported is True
|
||||
assert theItem.isActive is True
|
||||
assert theItem.charCount == 0
|
||||
assert theItem.wordCount == 0
|
||||
assert theItem.paraCount == 0
|
||||
@@ -728,7 +728,7 @@ def testCoreItem_ConvertFromFmt13(mockGUI):
|
||||
assert theItem.itemParent == "a000000000001"
|
||||
assert theItem.itemOrder == 2
|
||||
assert theItem.isExpanded is False
|
||||
assert theItem.isExported is True
|
||||
assert theItem.isActive is True
|
||||
assert theItem.charCount == 600
|
||||
assert theItem.wordCount == 100
|
||||
assert theItem.paraCount == 6
|
||||
|
||||
@@ -621,9 +621,9 @@ def testGuiProjTree_ContextMenu(qtbot, monkeypatch, nwGUI, fncDir, mockRnd):
|
||||
nwItem = projTree.theProject.tree[hNovelNote]
|
||||
|
||||
# Toggle exported flag
|
||||
assert nwItem.isExported is True
|
||||
projTree._toggleItemExported(hNovelNote)
|
||||
assert nwItem.isExported is False
|
||||
assert nwItem.isActive is True
|
||||
projTree._toggleItemActive(hNovelNote)
|
||||
assert nwItem.isActive is False
|
||||
|
||||
# Change item status
|
||||
assert nwItem.itemStatus == "s000000"
|
||||
|
||||
Reference in New Issue
Block a user