Пример #1
0
 def test_remove_first_node_single_item(self):
     dl_list = DoublyLinkedList([1])
     self.assertEqual(len([i for i in dl_list.items()]), 1)
     self.assertEqual(dl_list.removeFirstNode().value, 1)
     self.assertEqual(len([i for i in dl_list.items()]), 0)
Пример #2
0
 def test_remove_first_node_empty_list(self):
     dl_list = DoublyLinkedList()
     self.assertEqual(len([i for i in dl_list.items()]), 0)
     self.assertEqual(dl_list.removeFirstNode(), None)
     self.assertEqual(len([i for i in dl_list.items()]), 0)
Пример #3
0
 def test_remove_first_node(self):
     dl_list = DoublyLinkedList([1, 2, 3])
     self.assertEqual(len([i for i in dl_list.items()]), 3)
     self.assertEqual(dl_list.removeFirstNode().value, 1)
     self.assertEqual(len([i for i in dl_list.items()]), 2)