def test_math_sum(self): self.assertEqual(Math.sum([4, 5, None, 3]), 12) self.assertEqual(Math.sum([None]), 0) self.assertEqual(Math.sum([3.5, 4]), 7.5)
def test_sum_single_value(self): data = [10] actual = Math.sum(data) self.assertEqual(data[0], actual)
def test_sum_multi_value_with_null(self): data = [10, 20, None, 30, 40, 50] actual = Math.sum(data) self.assertEqual(150, actual)