예제 #1
0
 def test_add(self):
     node = Tree('a')
     child = Tree('b')
     node.add(child)
     self.assertEqual(1, node.child_count())
     self.assertEqual(child.parent, node)
     self.assertEqual(0, child.idx)
예제 #2
0
 def test_list_add(self):
     node = Tree('a')
     child = Tree('b')
     child2 = Tree('c')
     node.add(child, child2)
     self.assertEqual(2, node.child_count())