示例#1
0
 def test_unshift(self):
     test_list = DoubleLinkedList()
     test_list.unshift(1)
     test_list.unshift("test")
     test_list.unshift(3.2)
     self.assertEqual(test_list.len(), 3)
     self.assertEqual(test_list.show(), [3.2, "test", 1])
示例#2
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)
 def test_len(self):
     list_1 = DoubleLinkedList()
     list_1.push(1)
     list_1.unshift(2)
     self.assertEqual(list_1.len(), 1)