def test_remove(self): L = UnorderedList() data = [1, 2, 3, 4, 5] for d in data: L.add(d) L.remove(3) self.assertNotIn(3, self.get_data(L)) L.remove(5) self.assertNotIn(5, self.get_data(L))
def test_remove_with_one_element(self): L = UnorderedList() L.add(3) L.remove(3) self.assertNotIn(3, self.get_data(L)) self.assertEqual(L.size(), 0)