def test_delete_1(): ll = LinkedList(1) ll.append(2) ll.delete(0) assert 2 == ll[0] with pytest.raises(IndexError): ll[1]
def test_delete_error_2(): ll = LinkedList(1) ll.append(2) with pytest.raises(IndexError): ll.delete(3)
def test_delete_error_1(): ll = LinkedList() with pytest.raises(IndexError): ll.delete(0)
def test_delete_head(): ll = LinkedList(1) ll.delete(0) assert None is ll.head