Exemple #1
0
 def test_remove_last(self):
     mylist = OrderedList()
     mylist.add(1)
     mylist.add(2)
     mylist.add(3)
     mylist.remove(1)
     assert mylist.toList() == [2, 3]
Exemple #2
0
 def test_remove_first(self):
     mylist = OrderedList()
     mylist.add(1)
     mylist.add(2)
     mylist.add(3)
     mylist.remove(3)
     assert mylist.toList() == [1, 2]
Exemple #3
0
 def test_many_duplicates(self):
     mylist = OrderedList()
     mylist.add(3)
     mylist.add(3)
     mylist.add(3)
     mylist.remove(3)
     assert mylist.toList() == [3, 3]
Exemple #4
0
 def test_one_item(self):
     mylist = OrderedList()
     mylist.add(3)
     mylist.remove(3)
     assert mylist.isEmpty()
Exemple #5
0
 def test_empty_list(self):
     mylist = OrderedList()
     mylist.remove(1)
     assert mylist.isEmpty()