Beispiel #1
0
def test_fib1():
    assert fibonacci_class(10).fib() == 89
Beispiel #2
0
def test_fac4():
    with pytest.raises(ValueError) as excinfo:
        fibonacci_class("input string").fac()
    assert str(excinfo.value) == "Invalid input (type error)"
Beispiel #3
0
def test_fac1():
    assert fibonacci_class(10).fac() == 3628800
Beispiel #4
0
def test_fac2():
    assert fibonacci_class(-5).fac() == "Invalid input (sign error)"
Beispiel #5
0
def test_fib3():
    with pytest.raises(ValueError) as excinfo:
        fibonacci_class(1.2).fib()
    assert str(excinfo.value) == "Invalid input (type error)"