Example #1
0
 def test_SUMIF_with_invalid_sum_range(self):
     # In this case, "bad" is converted to a single item array, then
     # filtered to an array where the value is 0, so that the sum is always
     # 0.
     self.assertEqual(math.SUMIF([0, 1, 2, 3], ">=2", 'bad'), 0)
Example #2
0
 def test_SUMIF_unspecified_sum_range(self):
     self.assertEqual(math.SUMIF([0, 1, 2, 3], ">=2"), 5)
Example #3
0
 def test_SUMIF_invalid_criteria(self):
     self.assertIsInstance(math.SUMIF([0, 1, 2], [0, 1], [10, 20, 30]),
                           xlerrors.ValueExcelError)
Example #4
0
 def test_SUMIF(self):
     self.assertEqual(math.SUMIF([0, 1, 2], '>=1', [10, 20, 30]), 50)
Example #5
0
 def test_SUMIF_with_invlaid_sum_range(self):
     self.assertIsInstance(math.SUMIF([0, 1, 2, 3], ">=2", 'bad'),
                           xl.RangeExcelError)
Example #6
0
 def test_SUMIF_invalid_criteria(self):
     self.assertEqual(math.SUMIF([0, 1, 2], [0, 1], [10, 20, 30]), 0)