示例#1
0
def test_positive(data, value):
    """Testing the factorial() with value positive and 0
    """
    sum_ = sum_digits(factorial(data))
    if sum_ != value:
        print('Test_positive: Expected value is {}, '.format(value) +
              'actual is {}'.format(sum_))
示例#2
0
def test_exception_factorial(data, message):
    """Testing the factorial() to exception
    """
    try:
        sum_digits(factorial(data))
    except ModuleBaseException:
        pass
    else:
        print('Test exception factorial: excepted \'{}\', '.format(message) +
              'but got no exception\n')