def GET(self, numpart): try: numpart = int(numpart) result = fibonacci(numpart) except ValueError as e: return """{\n"Exception":"%s"\n}""" % (e) return """{\n"fib_results":%s\n}""" % (result)
def test_2(self): self.assertEqual(mymathlib.fibonacci(2), [0,1])
def test_4(self): self.assertEqual(mymathlib.fibonacci(4), [0,1,1,2])
def test_1(self): self.assertEqual(mymathlib.fibonacci(1), [0])
def test_3(self): self.assertEqual(mymathlib.fibonacci(3), [0,1,1])