예제 #1
0
def test_try_exception_value():
    with pytest.raises(ValueError):
        Functions.find_exceptions([56574564776846786])
예제 #2
0
def test_sum_decimals():
    test_sum = Functions.find_sum([1, 2.5, 3.5, 4])
    assert test_sum == 11
예제 #3
0
def test_try_exception_type():
    with pytest.raises(TypeError):
        Functions.find_exceptions(['a', 9, -1])
예제 #4
0
def test_sum():
    test_sum = Functions.find_sum([1, 2, 3, 4])
    assert test_sum == 10
예제 #5
0
def test_tuple_size():
    test_tuple = Functions.find_min_max([-3, 0.3, 8, 29])
    assert len(test_tuple) == 2
예제 #6
0
def test_precision():
    test_min_max = Functions.find_min_max([-3903, 0.389, 9870])
    assert test_min_max == (-3903, 9870)
예제 #7
0
def test_max():
    test_max = Functions.find_min_max([0, 2, 345, 890])
    assert test_max[1] == 890
예제 #8
0
def test_min():
    test_min = Functions.find_min_max([4, 2, 0])
    assert test_min[0] == 0
예제 #9
0
def test_sum_negative():
    test_sum = Functions.find_sum([-1, 2.5, 3.5, -4])
    assert test_sum == 1