예제 #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)
예제 #2
0
 def test_SUMIF_unspecified_sum_range(self):
     self.assertEqual(math.SUMIF([0, 1, 2, 3], ">=2"), 5)
예제 #3
0
 def test_SUMIF(self):
     self.assertEqual(math.SUMIF([0, 1, 2], '>=1', [10, 20, 30]), 50)
예제 #4
0
 def test_SUMIF_invalid_criteria(self):
     self.assertIsInstance(math.SUMIF([0, 1, 2], [0, 1], [10, 20, 30]),
                           xlerrors.ValueExcelError)
예제 #5
0
 def test_SUMIF_text(self):
     self.assertEqual(math.SUMIF(['a', 'b', 'A'], '=a', [10, 20, 30]), 40)