def test_index(): ll = LinkedList() ll.dump(5, 4, 3, 2, 1) assert ll.index(5) == 1 assert ll.index(3) == 3 assert ll.index(1) == 5
def test_valueerror_index(): ll = LinkedList() ll.dump(5, 4, 3, 2, 1) with pytest.raises(ValueError): ll.index(100)