def test_remove_after_first_item(self): dl_list = DoublyLinkedList([1, 2, 3]) with self.assertRaises(DoublyLinkedListError): dl_list.removeAfterNode(dl_list.lastnode())
def test_remove_after(self): dl_list = DoublyLinkedList([1, 2, 3]) self.assertEqual(len([i for i in dl_list.items()]), 3) dl_list.removeAfterNode(dl_list.firstnode()) self.assertEqual(dl_list.firstnode().next().value, 3) self.assertEqual(len([i for i in dl_list.items()]), 2)