예제 #1
0
def test_factorial():
    """
    Test factorial works properly
    """
    assert recursion.factorial(3) == 6, 'incorrect'
    assert recursion.factorial(2) == 2, 'incorrect'
    assert recursion.factorial(5) == 120, 'incorrect'
예제 #2
0
def test_factorial():
    '''
    make sure factorial works correctly
    '''
    assert recursion.factorial(5) == 120, 'incorrect'
    assert recursion.factorial(1) == 1, 'incorrect'
    assert recursion.factorial(13) == 6227020800, 'incorrect'
예제 #3
0
def test_factorial():
    """
    make sure factorial works correctly
    """

    assert recursion.factorial(0) == 1, 'incorrect'
    assert recursion.factorial(1) == 1, 'incorrect'
    assert recursion.factorial(5) == 120, 'incorrect'
예제 #4
0
def factorial(n):
    """
    retruns n!
    """

    assert recursion.factorial(5) == 120, 'incorrect'
    assert recursion.factorial(11) == 39916800, 'incorrect'
    assert recursion.factorial(7) == 5040, 'incorrect'
예제 #5
0
def reverse(word):
    """
    returns word in reverse
    """

    assert recursion.reverse(nakedi) == idekan, 'incorrect'
    assert recursion.reverse(evol) == love, 'incorrect'
    assert recursion.factorial(madam) == madam, 'incorrect'
예제 #6
0
파일: test.py 프로젝트: thabied/mypackage
from mypackage import recursion

assert recursion.factorial(3) == 6, 'incorrect'
예제 #7
0
def test_factorial():
    assert recursion.factorial(5) == 120, 'Correct'
    assert recursion.factorial(8) == 40320, 'Correct'
예제 #8
0
def test_factorial(n):
    '''Test Factorial: !n'''
    assert recursion.factorial(2) == 2
    assert recursion.factorial(5) == 120
    assert recursion.factorial(7) == 5040