Example #1
0
 def test_fib_6(self):
     self.assertEqual(fibonacci(6), 8)
     self.assertEqual(dynamic_fibonacci(6, lookup=[None] * 101), 8)
Example #2
0
 def test_fib_max(self):
     self.assertEqual(fibonacci(34), 5702887)
     self.assertEqual(dynamic_fibonacci(99, lookup=[None] * 101),
                      218922995834555169026)
Example #3
0
 def test_fib_5(self):
     self.assertEqual(fibonacci(5), 5)
     self.assertEqual(dynamic_fibonacci(5, lookup=[None] * 101), 5)
Example #4
0
 def test_fib_4(self):
     self.assertEqual(fibonacci(4), 3)
     self.assertEqual(dynamic_fibonacci(4, lookup=[None] * 101), 3)
Example #5
0
 def test_fib_3(self):
     self.assertEqual(fibonacci(3), 2)
     self.assertEqual(dynamic_fibonacci(3, lookup=[None] * 101), 2)
Example #6
0
 def test_fib_2(self):
     self.assertEqual(fibonacci(2), 1)
     self.assertEqual(dynamic_fibonacci(2, lookup=[None] * 101), 1)
Example #7
0
 def test_fib_0(self):
     self.assertEqual(fibonacci(0), 0)
     self.assertEqual(dynamic_fibonacci(0, lookup=[None] * 101), 0)