def test_node_has_both_children(self): node = Node(10, left=Node(5), right=Node(2)) expected = (node.has_left_child() and node.has_right_child()) self.assertTrue(expected)
def test_node_has_right_child(self): node = Node(10, left=None, right=Node(2)) self.assertTrue(node.has_right_child()) self.assertFalse(node.has_left_child())