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)
예제 #2
0
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))
예제 #4
0
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_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)
 def test_with_three(self):
     self.assertEqual(2, nth_fibonacci(3))
예제 #9
0
def test_second_fibonacci_number_is_1():
    result = nth_fibonacci(1)

    assert result == 1
예제 #10
0
파일: wrapper.py 프로젝트: wijwij/fibo66
import sys
from nth_fibonacci import nth_fibonacci
print(nth_fibonacci(
    sys.argv[1]))  # call the function on the first command line arg
예제 #11
0
def test_tenth_fibonacci_number_is_34():
    result = nth_fibonacci(9)

    assert result == 34
예제 #12
0
def test_first_fibonacci_number_is_0():
    result = nth_fibonacci(0)

    assert result == 0
예제 #13
0
def test_fifth_fibonacci_number_is_3():
    result = nth_fibonacci(4)

    assert result == 3
예제 #14
0
def test_fouth_fibonacci_number_is_2():
    result = nth_fibonacci(3)

    assert result == 2
예제 #15
0
def test_third_fibonacci_number_is_1():
    result = nth_fibonacci(2)

    assert result == 1