def test_solution(): from solution import fibonacci assert fibonacci(n=5) == 5 assert fibonacci(n=10) == 55 assert fibonacci(n=15) == 610 assert fibonacci(n=1) == 1
def test_solution(): import solution assert solution.fibonacci(n=5) == 5 assert solution.fibonacci(n=10) == 55 assert solution.fibonacci(n=15) == 610
def test_basic(self): input_number = 18 output_number = solution.fibonacci(input_number) expected_number = 4181 self.assertEqual(output_number, expected_number)
def test_basic(self): input_number= 18 output_number= solution.fibonacci(input_number) expected_number = 4181 self.assertEqual(output_number,expected_number)
def test_fibonacci(self): fibonacci = solution.fibonacci() first_five = list(islice(fibonacci, 5)) self.assertEqual(first_five, [1, 1, 2, 3, 5])
def test_invalid_input(): assert solution.fibonacci(n=0) == -1 assert solution.fibonacci(n=-10) == -1
def test_iterative_solution(): assert solution.fibonacci(10000)
def test_efficiency(): start = time.time() solution.fibonacci(37) efficiency = time.time() - start assert efficiency < 0.001
def main(): line = sys.stdin.readline() n = int(line) print solution.fibonacci(n)
def test_fibonacci(n, result): assert fibonacci(n) == result