Exemplo n.º 1
0
 def test_clear(self):
     dll = LinkedList()
     items = 100
     assert dll.is_empty()
     for i in range(items):
         assert dll.append(i) is None
     assert isinstance(dll.head, Node)
     assert isinstance(dll.tail, Node)
     assert dll.size == items
     assert dll.clear() is None
     assert dll.head is None
     assert dll.tail is None
     assert dll.size == 0
Exemplo n.º 2
0
 def test_clear_empty(self):
     dll = LinkedList()
     assert dll.is_empty()
     assert dll.clear() is None
     assert dll.is_empty()