def test_nth_fibonacci(self): self.assertEqual(nth_fibonacci(1), 1) self.assertEqual(nth_fibonacci(2), 1) self.assertEqual(nth_fibonacci(3), 2) self.assertEqual(nth_fibonacci(10), 55)
import sys from nth_fibonacci import nth_fibonacci print nth_fibonacci(sys.argv[1]) # call the function on the first command line arg
def test_with_two(self): self.assertEqual(1, nth_fibonacci(2))
import sys from nth_fibonacci import nth_fibonacci print nth_fibonacci(sys.argv[1])
def test_with_ten(self): self.assertEqual(55, nth_fibonacci(10))
def test_with_one(self): self.assertEqual(1, nth_fibonacci(1))
def test_with_three(self): self.assertEqual(2, nth_fibonacci(3))
def test_second_fibonacci_number_is_1(): result = nth_fibonacci(1) assert result == 1
import sys from nth_fibonacci import nth_fibonacci print(nth_fibonacci( sys.argv[1])) # call the function on the first command line arg
def test_tenth_fibonacci_number_is_34(): result = nth_fibonacci(9) assert result == 34
def test_first_fibonacci_number_is_0(): result = nth_fibonacci(0) assert result == 0
def test_fifth_fibonacci_number_is_3(): result = nth_fibonacci(4) assert result == 3
def test_fouth_fibonacci_number_is_2(): result = nth_fibonacci(3) assert result == 2
def test_third_fibonacci_number_is_1(): result = nth_fibonacci(2) assert result == 1