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