def test_fib_class(): obj = Fib() assert obj.at(1) == 1 assert obj.at(2) == 1 assert list(obj.get_all(2)) == [1, 1] assert list(obj.get_all(6)) == [1, 1, 2, 3, 5, 8]
def test_get_all(self): obj = Fib() self.assertEqual([1], list(obj.get_all(1))) self.assertEqual([1, 1], list(obj.get_all(2))) self.assertEqual([1, 1, 2, 3, 5, 8], list(obj.get_all(6)))