def test1(self): slist = [1, 1] f = Fibonacci(1, 2, slist) res1 = f.next() res2 = f.next() res3 = f.next() res4 = f.next() # print res1, res2, res3, res4 self.assertEqual(2, res1) self.assertEqual(3, res2) self.assertEqual(5, res3) self.assertEqual(8, res4)
def test2(self): slist = [1, 2, 3, 4, 5] f = Fibonacci(2, 5, slist) res1 = f.next() res2 = f.next() res3 = f.next() res4 = f.next() # print res1, res2, res3, res4 self.assertEqual(5, res1) self.assertEqual(7, res2) self.assertEqual(8, res3) self.assertEqual(11, res4)