示例#1
0
    def test_size(self):
        mylist = OrderedList()
        self.assertEquals(mylist.size(), 0)

        mylist.add(1)
        self.assertEquals(mylist.size(), 1)

        mylist.add(2)
        self.assertEquals(mylist.size(), 2)
示例#2
0
    def test_pop(self):
        mylist = OrderedList()
        mylist.add(1)
        mylist.add(2)
        mylist.add(3)

        self.assertEqual(mylist.pop(), 3)
        self.assertEqual(mylist.size(), 2)