def test_search_falsey(): """Can successfully determin that no values exist in an empty binary search tree""" bst = BinarySearchTree() expected = False actual = bst._contains(10) assert actual == expected
def test_search_falsey(): """Can successfully determine that a value does not exist in a binary search tree""" bst = BinarySearchTree() bst.add(10) bst.add(5) bst.add(20) bst.add(8) bst.add(15) expected = False actual = bst._contains(25) assert actual == expected
def test_search_another_node_truthy(): """Can successfully find a value that exists in a binary search tree""" bst = BinarySearchTree() bst.add(10) bst.add(5) bst.add(20) bst.add(8) bst.add(15) expected = True actual = bst._contains(5) assert actual == expected