Exemplo n.º 1
0
def test_fib(n, result):
    """Test for fib using n_values list."""
    from series import fib
    assert fib(n) == result
Exemplo n.º 2
0
def test_fib(n, result):
    """Test to see if the Fibonacci nonsense returns the appropriate value."""
    from series import fib
    assert fib(n) == result
Exemplo n.º 3
0
import series
# from series import fib #importing a particular function into a program. when there is more than one function write them comma separated.
#  from series import *

print(series.fib(10))

# Import package in the script
# import it
# it.seit()
# it.teit()
# it.beit()
Exemplo n.º 4
0
def test_fib_seven():
    '''Test fib function to check value 7 of fibonacci'''
    from series import fib
    assert fib(7) == 8
Exemplo n.º 5
0
def test_fib_one():
    '''Test fib function to check value 1 of fibonacci'''
    from series import fib
    assert fib(1) == 0
Exemplo n.º 6
0
def test_fib_0():
    from series import fib
    assert fib(0) == 0
Exemplo n.º 7
0
def test_fib_1():
    """Test fib with n of 1, should return 0."""
    from series import fib
    assert fib(1) == 0
Exemplo n.º 8
0
def test_fib(n, expected):
    assert series.fib(n) is expected
Exemplo n.º 9
0
def test_fib_two():
    '''Test fib function to check value 2 of fibonacci'''
    from series import fib
    assert fib(2) == 1
Exemplo n.º 10
0
def test_fib_string():
    """Test fib with string, should raise TypeError."""
    from series import fib
    with pytest.raises(TypeError):
        fib('string')
Exemplo n.º 11
0
def test_fib_0():
    """Test fib with n of 0, should return 0."""
    from series import fib
    assert fib(0) == 0
Exemplo n.º 12
0
def test_fib_10():
    """Test fib with n of 10, should return 34."""
    from series import fib
    assert fib(10) == 34
Exemplo n.º 13
0
def test_fib_5():
    """Test fib with n of 5, should return 3."""
    from series import fib
    assert fib(5) == 3
Exemplo n.º 14
0
def test_fib_2():
    """Test fib with n of 2, should return 1."""
    from series import fib
    assert fib(2) == 1
Exemplo n.º 15
0
def test_fib_6():
    from series import fib
    assert fib(6) == 8
Exemplo n.º 16
0
def test_fib_zero():
    '''Test fib function to check value 0 of fibonacci'''
    from series import fib
    assert fib(0) == 0
Exemplo n.º 17
0
def test_fib_20():
    from series import fib
    assert fib(20) == 6765
Exemplo n.º 18
0
def test_fib_five():
    '''Test fib function to check value 5 of fibonacci'''
    from series import fib
    assert fib(5) == 3
Exemplo n.º 19
0
def test_fib_3():
    from series import fib
    assert fib(3) == 2
Exemplo n.º 20
0
def test_fib(n, result):
    """Test Fibonacci function."""
    from series import fib
    assert fib(n) == result