Example #1
0
def test_insert_node_before_head():
    ll = LinkedList()
    ll.append("apples")
    ll.insert_before("apples", "lemons")
    assert str(ll) == "{ lemons } -> { apples } -> None"
Example #2
0
def test_insert_node_no_value_match():
    ll = LinkedList()
    ll.append("apples")
    ll.insert_before("Blueberries", "lemons")
    assert -1
Example #3
0
def test_append_node_to_empty_list():
    ll = LinkedList()
    ll.append("lemons")
    assert str(ll) == "{ lemons } -> None"