def test_search_multivalued_list__value_does_not_exists__return_false( self): alist = LinkedList() for i in range(1, 4): alist.insert_at_head(i) assert str(alist) == "3 -> 2 -> 1 -> None" assert alist.search(4) is False
def test_search__empty_list__return_false(self): alist = LinkedList() assert alist.is_empty() is True assert alist.search(1) is False
def test_search__list_has_one_non_existing_element__return_true(self): alist = LinkedList(Node(1)) assert str(alist) == "1 -> None" assert alist.search(2) is False