def test_integerListAdd_whenValueNotInteger_shouldRaise(self): il = IntegerList() with self.assertRaises(Exception) as context: il.add({}) self.assertIsNotNone(context.exception)
def test_integerListAdd_whenValueIsInteger_shouldBeAdded(self): il = IntegerList() il.add(1) self.assertListEqual([1], il.get_data())