Example #1
0
 def test_many_items_last(self):
     mylist = OrderedList()
     mylist.add(1)
     mylist.add(2)
     mylist.add(3)
     assert mylist.pop(-1) == 3
     assert mylist.size() == 2
Example #2
0
 def test_many_items_middle(self):
     mylist = OrderedList()
     mylist.add(1)
     mylist.add(2)
     mylist.add(3)
     assert mylist.pop(-2) == 2
     assert mylist.size() == 2
Example #3
0
 def test_many_items_first(self):
     mylist = OrderedList()
     mylist.add(1)
     mylist.add(2)
     mylist.add(3)
     assert mylist.pop(0) == 1
     assert mylist.size() == 2
Example #4
0
 def test_clear(self):
     mylist = OrderedList()
     mylist.add(1)
     mylist.add(2)
     mylist.add(3)
     mylist.clear()
     assert mylist.size() == 0
     assert mylist.isEmpty()
     assert mylist.toList() == []
Example #5
0
 def test_size(self):
     mylist = OrderedList()
     mylist.add(1)
     mylist.add(2)
     assert mylist.size() == 2