def test_SUM_with_nonnumbers_in_range(self): self.assertEqual(math.SUM(func_xltypes.Array([[1, 'bad'], [3, 4]])), 8) self.assertEqual(math.SUM( func_xltypes.Array([ [func_xltypes.Number(1), func_xltypes.Text('N/A')], [func_xltypes.Number(3), func_xltypes.Number(4)] ])), 8)
def test_SUM_with_bad_Arg(self): self.assertEqual(math.SUM('foo'), 0)
def test_SUM(self): self.assertEqual(math.SUM(func_xltypes.Array([[1, 2], [3, 4]])), 10) self.assertEqual(math.SUM(1, 2, 3, 4.0), 10.0)
def test_SUM_empty(self): self.assertEqual(math.SUM(), 0)