Esempio n. 1
0
 def test_remove_before(self):
     dl_list = DoublyLinkedList([1, 2, 3])
     self.assertEqual(len([i for i in dl_list.items()]), 3)
     dl_list.removeBeforeNode(dl_list.lastnode())
     self.assertEqual(dl_list.lastnode().prev().value, 1)
     self.assertEqual(len([i for i in dl_list.items()]), 2)
Esempio n. 2
0
 def test_remove_before_first_item(self):
     dl_list = DoublyLinkedList([1, 2, 3])
     with self.assertRaises(DoublyLinkedListError):
         dl_list.removeBeforeNode(dl_list.firstnode())