Example #1
0
	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)
Example #2
0
	def test_2(self):
		self.assertEqual(mymathlib.fibonacci(2), [0,1])
Example #3
0
	def test_4(self):
		self.assertEqual(mymathlib.fibonacci(4), [0,1,1,2])
Example #4
0
	def test_1(self):
		self.assertEqual(mymathlib.fibonacci(1), [0])
Example #5
0
	def test_3(self):
		self.assertEqual(mymathlib.fibonacci(3), [0,1,1])