def test_search(self): sll = Sll() # Test an empty Linked List assert sll.search(5) == 'Linked list is empty' # Test Linked List with some nodes sll.add_at_head(1) sll.add_at_head(2) sll.add_at_head(3) assert sll.search('python') is False assert sll.search(3) is True
def test_remove(self): sll = Sll() # Test an empty Linked List assert sll.remove(5) == "Linked list is empty" # Test Linked List with some nodes sll.add_at_head(1) sll.add_at_head(2) sll.add_at_head(3) assert str(sll.remove(24)) == 'A Node with given data is not present.' assert sll.search(2) is True sll.remove(2) assert sll.search(2) is False