示例#1
0
 def test_shift_empty(self):
     test_list = DoubleLinkedList()
     self.assertEqual(test_list.shift(), "list is empty")
示例#2
0
 def test_shift(self):
     test_list = DoubleLinkedList()
     for i in range(5):
         test_list.push(i)
     for i in range(5):
         self.assertEqual(test_list.shift(), i)
示例#3
0
 def test_unshift_shift(self):
     test_list = DoubleLinkedList()
     test_list.unshift(5)
     self.assertEqual(test_list.len(), 1)
     self.assertEqual(test_list.shift(), 5)