Esempio n. 1
0
def test_remove():
    """ Test remove """
    l = DoubleLinkedList()
    with pytest.raises(LookupError):
        l.remove(1)
    for i in range(1, 4):
        l.append(i)
    assert l.remove(2)
    assert l.head.value == 1
    assert l.head.next.value == 3
    assert l.tail.value == 3
    assert l._size == 2
def test_remove():
    """ Test remove """
    l = DoubleLinkedList()
    with pytest.raises(LookupError):
        l.remove(1)
    for i in range(1,4):
        l.append(i)
    assert l.remove(2)
    assert l.head.value == 1
    assert l.head.next.value == 3
    assert l.tail.value == 3
    assert l._size == 2
    
    
    
    
    
    
    
    
    
    
def test_remove_error():
    from double_linked import DoubleLinkedList
    new_list = DoubleLinkedList(LIST_INPUT)
    with pytest.raises(ValueError):
        new_list.remove('eight')
def test_remove():
    from double_linked import DoubleLinkedList
    new_list = DoubleLinkedList(LIST_INPUT)
    new_list.remove(9)
    new_list.remove(7)
    assert new_list.head.data == 8
def test_remove_error():
    from double_linked import DoubleLinkedList
    new_list = DoubleLinkedList(LIST_INPUT)
    with pytest.raises(ValueError):
        new_list.remove('eight')
def test_remove():
    from double_linked import DoubleLinkedList
    new_list = DoubleLinkedList(LIST_INPUT)
    new_list.remove(9)
    new_list.remove(7)
    assert new_list.head.data == 8