Exemple #1
0
def test_exception_sum_digits(data, message):
    """Testing the sum_digits() to exception
    """
    try:
        sum_digits(data)
    except ModuleBaseException:
        pass
    else:
        print('Test exception sum_digits: excepted \'{}\', '.format(message) +
              'but got no exception\n')
Exemple #2
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_))
Exemple #3
0
def test_negative(data, value):
    """Testing the sum_digits() with value negative
    """
    sum_ = sum_digits(data)
    if sum_ != value:
        print('Test_negative: Expected value is {}, '.format(value) +
              'actual is {}'.format(sum_))