예제 #1
0
def test_fibonacci():
    '''
    make sure fibonacci works correctly
    '''
    assert recursion.fibonacci(1) == 1, 'incorrect'
    assert recursion.fibonacci(7) == 13, 'incorrect'
    assert recursion.fibonacci(15) == 610, 'incorrect'
예제 #2
0
def test_fibonacci():

        '''
        Ensures that fibonacci with recursion works.
        '''
        assert recursion.fibonacci(9)==34,'incorrect'
        assert recursion.fibonacci(10)==55,'incorrect'
        assert recursion.fibonacci(11)==89,'incorrect'
예제 #3
0
def test_factorial():

        '''
        Ensures that factorial works with recursion works.
        '''
        assert recursion.fibonacci(3)==6,'incorrect'
        assert recursion.fibonacci(4)==24,'incorrect'
        assert recursion.fibonacci(10)==3628800,'incorrect'
예제 #4
0
def test_fibonacci():
    """
    make sure fibonacci works correctly
    """

    assert recursion.fibonacci(0) == 0, 'incorrect'
    assert recursion.fibonacci(1) == 1, 'incorrect'
    assert recursion.fibonacci(5) == 5, 'incorrect'
예제 #5
0
def fibonacci(n):
    """
    returns nth term in fibonacci sequence
    """

    assert recursion.fibonacci(2) == 1, 'incorrect'
    assert recursion.fibonacci(5) == 5, 'incorrect'
    assert recursion.fibonacci(10) == 55, 'incorrect'
예제 #6
0
def test_fibonacci():
    """
    Make sure fibonacci works properly

    """

        assert recursion.fibonacci(8) == 21, 'incorrect'
        assert recursion.fibonnacci(0) == 1, 'incorrect'
        assert recursion.fibonacci(4) == 3, 'incorrect'
예제 #7
0
def test_fibonacci():
    assert recursion.fibonacci(8) == 21, 'Correct'
    assert recursion.fibonacci(15) == 610, 'Correct'
예제 #8
0
def test_fibonacci(n):
    '''Test fibonacci to return nth number in sequence'''

    assert recursion.fibonacci(6) == 8
    assert recursion.fibonacci(12) == 144
    assert recursion.fibonacci(20) == 6765