Ejemplo n.º 1
0
def test_constructor():
    items = ("duck", 3, [2, 3, 4], object())
    dll = DoubleLinkedList(items)
    dll2 = DoubleLinkedList()
    for i in items[::-1]:
        dll2.insert(i)
    for i in items:
        assert dll.pop() == dll2.pop()
Ejemplo n.º 2
0
def test_pop():
    dll = DoubleLinkedList(("dog", 3, "fish taco", object(), "house"))
    assert "dog" == dll.pop()
Ejemplo n.º 3
0
def test_insert():
    dll = DoubleLinkedList()
    dll.insert(5)
    assert dll.pop() == 5