Пример #1
0
 def test_sum_range_not_list(self):
     with pytest.raises(TypeError):
         sumifs(
             'JUNK',
             [],
             [],
         )
Пример #2
0
 def test_ifs_size_errors(self):
     criteria, v1 = self.responses['sumifs'][0][1:]
     v2 = (v1[0][:-1], )
     assert countifs(v1, criteria, v2, criteria) == VALUE_ERROR
     assert sumifs(v1, v1, criteria, v2, criteria) == VALUE_ERROR
     assert maxifs(v1, v1, criteria, v2, criteria) == VALUE_ERROR
     assert minifs(v1, v1, criteria, v2, criteria) == VALUE_ERROR
     assert averageifs(v1, v1, criteria, v2, criteria) == VALUE_ERROR
Пример #3
0
 def test_multiple_criteria(self):
     assert 7 == sumifs(((1, 2, 3, 4, 5), ),
                        ((1, 2, 3, 4, 5), ), ">=3",
                        ((1, 2, 3, 4, 5), ), "<=4")
Пример #4
0
 def test_regular_with_number_criteria(self):
     assert 6 == sumifs(((1, 1, 2, 2, 2), ), ((1, 1, 2, 2, 2), ), 2)
Пример #5
0
 def test_sum_range_with_less_indexes(self):
     assert 35 == sumifs([100, 123, 12, 23], [1, 2, 3, 4, 5], ">=3")
Пример #6
0
 def test_sum_range(self):
     assert 668 == sumifs([100, 123, 12, 23, 633], [1, 2, 3, 4, 5], ">=3")
Пример #7
0
 def test_regular_with_number_criteria(self):
     assert 6 == sumifs([1, 1, 2, 2, 2], [1, 1, 2, 2, 2], 2)
Пример #8
0
def test_sumifs(data, result):
    if isinstance(result, type(Exception)):
        with pytest.raises(result):
            sumifs(*data)
    else:
        assert sumifs(*data) == result
Пример #9
0
 def test_sum_range_is_a_list(self):
     with pytest.raises(TypeError):
         sumifs(12, 12, 12)
Пример #10
0
 def test_multiple_criteria(self):
     assert 7 == sumifs(((1, 2, 3, 4, 5), ), ((1, 2, 3, 4, 5), ), ">=3",
                        ((1, 2, 3, 4, 5), ), "<=4")
Пример #11
0
 def test_sum_range_with_empty(self):
     assert 35 == sumifs(((100, 123, 12, 23, None), ), ((1, 2, 3, 4, 5), ),
                         ">=3")
Пример #12
0
 def test_sum_range_rect(self):
     assert 35 == sumifs(((100, 123), (12, 23)), ((1, 2), (3, 4)), ">=3")
Пример #13
0
 def test_sum_range(self):
     assert 668 == sumifs(((100, 123, 12, 23, 633), ), ((1, 2, 3, 4, 5), ),
                          ">=3")
Пример #14
0
 def test_regular_with_string_criteria(self):
     assert 12 == sumifs(((1, 2, 3, 4, 5), ), ((1, 2, 3, 4, 5), ), ">=3")
Пример #15
0
 def test_sumifs(result, criteria, values):
     assert sumifs(values, values, criteria) == result
Пример #16
0
 def test_regular_with_number_criteria(self):
     assert 6 == sumifs(((1, 1, 2, 2, 2), ), ((1, 1, 2, 2, 2), ), 2)
Пример #17
0
 def test_regular_with_string_criteria(self):
     assert 12 == sumifs(((1, 2, 3, 4, 5), ), ((1, 2, 3, 4, 5), ), ">=3")
Пример #18
0
 def test_sum_range_is_a_list(self):
     with pytest.raises(TypeError):
         sumifs(12, 12, 12)
Пример #19
0
 def test_sum_range(self):
     assert 668 == sumifs(((100, 123, 12, 23, 633), ),
                          ((1, 2, 3, 4, 5), ), ">=3")
Пример #20
0
 def test_regular_with_string_criteria(self):
     assert 12 == sumifs([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], ">=3")
Пример #21
0
 def test_sum_range_rect(self):
     assert 35 == sumifs(((100, 123), (12, 23)), ((1, 2), (3, 4)), ">=3")
Пример #22
0
 def test_sum_range_with_more_indexes(self):
     assert 668 == sumifs([100, 123, 12, 23, 633, 1], [1, 2, 3, 4, 5],
                          ">=3")
Пример #23
0
 def test_sum_range_with_empty(self):
     assert 35 == sumifs(((100, 123, 12, 23, None), ),
                         ((1, 2, 3, 4, 5), ), ">=3")
Пример #24
0
 def test_sum_range_with_empty(self):
     assert 35 == sumifs([100, 123, 12, 23, None], [1, 2, 3, 4, 5], ">=3")
Пример #25
0
 def test_sum_range_not_list(self):
     with pytest.raises(TypeError):
         sumifs('JUNK', ((), ), ((), ), )
Пример #26
0
 def test_multiple_criteria(self):
     assert 7 == sumifs([1, 2, 3, 4, 5], [1, 2, 3, 4, 5], ">=3",
                        [1, 2, 3, 4, 5], "<=4")
Пример #27
0
 def test_sumifs(expected, criteria, values):
     assert sumifs(values, values, criteria) == expected