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