def test_two(dummy_balanced_4levels_tree): expected = True dummy_balanced_4levels_tree.add(4) actual = check_balanced(dummy_balanced_4levels_tree) assert actual == expected, 'Error on test_two.'
def test_tree(dummy_balanced_4levels_tree): expected = False dummy_balanced_4levels_tree.add(4) dummy_balanced_4levels_tree.add(3) actual = check_balanced(dummy_balanced_4levels_tree) assert actual == expected, 'Error on test_tree.'
def test_four(): BST = BinarySearchTree() # level 0 BST.add(100) # level 1 BST.add(50) # level 2 BST.add(25) BST.add(15) BST.add(40) expected = False actual = check_balanced(BST) assert actual == expected, 'Error on test_four.'
def test_one(dummy_balanced_4levels_tree): expected = True actual = check_balanced(dummy_balanced_4levels_tree) assert actual == expected, 'Error on test_one.'