def testSetLeaf(self): n = Node((1, 'a')) n.setLeaf('c', 3) n.setLeaf('b', 2) self.assertEqual(n.leafs, [(1, 'a'), (2, 'b'), (3, 'c')])