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