Beispiel #1
0
def test_case_1():
    """Test_case_1."""
    assert series_sum(1) == "1.00"
Beispiel #2
0
def test_sum_terms(n, result):
    """Test sum_terms function."""
    from sum_terms import series_sum
    assert series_sum(n) == result
Beispiel #3
0
def test_case_7():
    """Test_case_7."""
    assert series_sum(7) == "1.68"
Beispiel #4
0
def test_case_fail():
    """test_case_fail."""
    with pytest.raises(Exception):
        series_sum()
Beispiel #5
0
def test_case_5():
    """Test_case_5."""
    assert series_sum(5) == "1.57"
Beispiel #6
0
def test_case_6():
    """Test_case_6."""
    assert series_sum(6) == "1.63"
Beispiel #7
0
def test_case_4():
    """Test_case_4."""
    assert series_sum(4) == "1.49"
Beispiel #8
0
def test_case_3():
    """Test_case_3."""
    assert series_sum(3) == "1.39"
Beispiel #9
0
def test_case_2():
    """Test_case_2."""
    assert series_sum(2) == "1.25"
Beispiel #10
0
def test1(inp, result):
    """checks numbers by index in the series defined by x = 1 / (1 + n * 3)"""
    from sum_terms import series_sum
    assert series_sum(inp) == result
Beispiel #11
0
def test_sum_terms(num, result):
    """Test for summing the first nth term of a series."""
    from sum_terms import series_sum
    assert series_sum(num) == result