示例#1
0
 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)
示例#2
0
 def test_last_only(self):
     test_list = DoubleLinkedList()
     test_list.push("test")
     self.assertEqual(test_list.last(), "test")
示例#3
0
 def test_last_empty(self):
     test_list = DoubleLinkedList()
     self.assertEqual(test_list.last(), "list is empty")