def test_last(self): test_list = DoubleLinkedList() for i in range(5): test_list.push(i) self.assertEqual(test_list.last(), 4) self.assertEqual(test_list.len(), 5)
def test_last_only(self): test_list = DoubleLinkedList() test_list.push("test") self.assertEqual(test_list.last(), "test")
def test_last_empty(self): test_list = DoubleLinkedList() self.assertEqual(test_list.last(), "list is empty")