Beispiel #1
0
def test_aoeu_input_exception():
    with pytest.raises(TypeError):
        fibonacci('aoeu')
Beispiel #2
0
def test_negative_input_exception():
    with pytest.raises(ValueError):
        fibonacci(-1)
Beispiel #3
0
def test_none_input_exception():
    with pytest.raises(TypeError):
        fibonacci(None)
Beispiel #4
0
def test_eval(test_input, expected):
    assert fibonacci(test_input) == expected
Beispiel #5
0
def test_five_input():
    assert fibonacci(5) == 5
Beispiel #6
0
def test_one_input():
    assert fibonacci(1) == 1
Beispiel #7
0
def test_zero_input():
    assert fibonacci(0) == 0