Esempio n. 1
0
 def test_multi_inheritance(self):
     tree = IndexTree()
     tree.add("name1", ["name2", "name3"])
     tree.add("name2", ["name4"])
     tree.add("name3", [])
     tree.add("name4", [])
     names = list(tree.iternames())
     assert len(names) == 4
     assert names.index("name1") > names.index("name2")
     assert names.index("name2") > names.index("name4")
     assert names.index("name1") == 3
Esempio n. 2
0
 def test_basic(self):
     tree = IndexTree()
     tree.add("name1", ["name2"])
     tree.add("name2", ["name3"])
     tree.add("name3", None)
     assert list(tree.iternames()) == ["name3", "name2", "name1"]