Exemple #1
0
 def test_fact(self):
     #This function tests whether result is equal to factorial
     self.assertEqual(factorial(5), 120)
Exemple #2
0
def test_factorial_1(app):
    try:
        assert app.factorial(1) == 1
    except AttributeError:
        raise AttributeError("The function 'factorial' should return the value 1")
Exemple #3
0
def test_factorial_8(app):
    try:
        assert app.factorial(8) == 40320
    except AttributeError:
        raise AttributeError("The function 'factorial' should return the value 40320")
Exemple #4
0
 def test_factorial_1(self):
     self.assertEqual(factorial(1), 1)
Exemple #5
0
    def test_factorial_1(self):
        self.assertEqual(factorial(1), 1)


# if __name__ == '__main__':
#     unittest.main()
Exemple #6
0
 def test_factorial_4(self):
     self.assertEqual(factorial(4), 24)