Esempio n. 1
0
 def test_delete_children(self):
     #
     # Delete child 2
     #
     node = Tree(n_children=4)
     node.split()
     node.delete_children(2)
     self.assertIsNone(node.get_child(2))
     #
     # Delete all children
     #
     node.delete_children()
     self.assertFalse(node.has_children())
Esempio n. 2
0
 def test_split(self):
     node = Tree(n_children=5)
     self.assertFalse(node.has_children(), 'Node should not have children.')
     node.split()
     self.assertTrue(node.has_children(), 'Node should now have children.')