def test5(self):
        factnumbers = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800]
        result = True
        i = 0
        for x in factnumbers:
            if fibonacci.fact(i) != x:
                result = False
            i = i + 1

        self.assertTrue(result)
Ejemplo n.º 2
0
 def test_fibo2(self):
     self.assertEqual(fibonacci.fact(8), 40320)
Ejemplo n.º 3
0
 def test_fact1(self):
     self.assertEqual(fibonacci.fact(6), 720)
 def test8(self):
     with self.assertRaises(TypeError):
         fibonacci.fact(0.5)
 def test7(self):
     with self.assertRaises(ValueError):
         fibonacci.fact(-1)
 def test6(self):
     with self.assertRaises(TypeError):
         fibonacci.fact("Test")