def test_unvalid_left_4levels(dummy_valid_4levels_tree):
    expected = False
    dummy_valid_4levels_tree.root.right.left.value = 50

    actual = validate_bst(dummy_valid_4levels_tree)

    assert actual == expected, 'Error on test_unvalid_left_4levels.'
def test_valid_letters():
    BST = BinarySearchTree()
    # level 0
    BST.add('d')
    # level 1
    BST.add('b')
    BST.add('f')
    # level 2
    BST.add('a')
    BST.add('c')
    BST.add('e')
    BST.add('g')

    expected = True

    actual = validate_bst(BST)

    assert actual == expected, 'Error on test_valid_letters.'
def test_unvalid_left_letters():
    BST = BinarySearchTree()
    # level 0
    BST.add('d')
    # level 1
    BST.add('b')
    BST.add('f')
    # level 2
    BST.add('a')
    BST.add('c')
    BST.add('e')
    BST.add('g')

    expected = False
    BST.root.left.right.value = 'z'

    actual = validate_bst(BST)

    assert actual == expected, 'Error on test_unvalid_left_letters.'
def test_valid_empty():
    expected = False

    actual = validate_bst(BinarySearchTree())

    assert actual == expected, 'Error on test_valid_empty.'
def test_valid_4levels(dummy_valid_4levels_tree):
    expected = True

    actual = validate_bst(dummy_valid_4levels_tree)

    assert actual == expected, 'Error on test_valid_4levels.'