def test_succesor_when_succesor_is_in_right_subtree(self): node_90 = create_tree_for_testing_successor() tree = AVL(node_90) expect(tree.get_successor(tree.search(50))).to.be.equal(tree.get_root( ).get_left_child().get_right_child().get_left_child().get_left_child())
def test_succesor_when_succesor_is_the_first_turn_going_up(self): node_90 = create_tree_for_testing_successor() tree = AVL(node_90) expect(tree.get_successor(tree.search(70)).get_key()).to.equal( node_90.get_key())
def test_succesor_when_there_is_none(self): node_90 = create_tree_for_testing_successor() tree = AVL(node_90) expect(tree.get_successor(tree.search(105))).to.be.equal(None)