Example #1
0
 def test_fibonacci_math(self):
     self.assertEqual(app.fibonacci(0), 0)
     self.assertEqual(app.fibonacci(1), 1)
     self.assertEqual(app.fibonacci(2), 1)
     self.assertEqual(app.fibonacci(3), 2)
     self.assertEqual(app.fibonacci(4), 3)
     self.assertEqual(app.fibonacci(5), 5)
Example #2
0
 def test_fibo(self):
     #This function test whether result is equal to fibonacci
     self.assertEqual(fibonacci(10), 55)
Example #3
0
 def test_fibonacci_function(self):
     gen = app.fibonacci()
     self.assertEqual(
         list(itertools.islice(gen, 0, 10)),
         [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
     )
Example #4
0
 def test_fibonacci_10(self):
     self.assertEqual(fibonacci(10), 89)
Example #5
0
 def test_fibonacci_1(self):
     self.assertEqual(fibonacci(1), 1)
Example #6
0
 def test_fibonacci_30(self):
     self.assertEqual(fibonacci(30), 1346269)
Example #7
0
 def test_fibonacci_function(self):
     gen = app.fibonacci()
     self.assertEqual(list(itertools.islice(gen, 0, 10)),
                      [0, 1, 1, 2, 3, 5, 8, 13, 21, 34])