def test_ll_insert_before5():
    ll = LinkedList()
    ll.append(5)
    ll.append(3)
    ll.append(1)
    with pytest.raises(Exception):
        ll.insert_before(7, 10)
def test_ll_insert_before4():
    ll = LinkedList()
    ll.append(5)
    ll.append(3)
    ll.append(1)
    ll.insert_before(5, 10)
    assert str(ll) == "{ 10 } -> { 5 } -> { 3 } -> { 1 } -> NULL"
def test_ll_insert_before2():
    ll = LinkedList()
    with pytest.raises(Exception):
        assert ll.insert_before(0, 5)
def test_ll_insert_before1():
    linklist = LinkedList()
    linklist.insert(0)
    linklist.insert(1)
    linklist.insert_before(0, 5)
    assert str(linklist) == "{ 1 } -> { 5 } -> { 0 } -> NULL"