Restructure the record of root items in the tree class
This commit is contained in:
@@ -284,6 +284,7 @@ def testCoreIndex_ScanText(nwMinimal, mockGUI):
|
||||
aHandle = theProject.newRoot("Archive", nwItemClass.ARCHIVE)
|
||||
assert theProject.projTree[aHandle] is not None
|
||||
xItem.setParent(aHandle)
|
||||
xItem.setRoot(aHandle)
|
||||
assert theIndex.scanText(xHandle, "Hello World!") is False
|
||||
|
||||
# Make some usable items
|
||||
|
||||
@@ -224,17 +224,10 @@ def testCoreTree_Methods(mockGUI, mockItems):
|
||||
assert theTree.checkType("c000000000001", nwItemType.FILE) is True
|
||||
|
||||
# Root item lookup
|
||||
theTree._treeRoots.append("stuff")
|
||||
assert theTree.findRoot(nwItemClass.WORLD) is None
|
||||
assert theTree.findRoot(nwItemClass.NOVEL) == "a000000000001"
|
||||
assert theTree.findRoot(nwItemClass.CHARACTER) == "a000000000004"
|
||||
|
||||
# Find root item of child item
|
||||
assert theTree.getRootItem("b000000000001").itemHandle == "a000000000001"
|
||||
assert theTree.getRootItem("c000000000001").itemHandle == "a000000000001"
|
||||
assert theTree.getRootItem("c000000000002").itemHandle == "a000000000001"
|
||||
assert theTree.getRootItem("stuff") is None
|
||||
|
||||
# Get item path
|
||||
assert theTree.getItemPath("stuff") == []
|
||||
assert theTree.getItemPath("c000000000001") == [
|
||||
|
||||
Reference in New Issue
Block a user