コード例 #1
0
def test_fibonacci_complexity(size):
    for n in Fib():
        if n >= size:
            break
    pass
コード例 #2
0
def test_fib_values(n, fib_lst):
    x = Fib()
    test_lst = [next(x) for i in range(n)]
    assert np.array_equal(test_lst, fib_lst), \
        "fibonacci sequences are not what is expected"
コード例 #3
0
def test_fib_iterator():
    x = Fib()
    assert hasattr(x, '__iter__'), \
        "Fib has no __iter__ special method."
コード例 #4
0
def test_fib_next():
    x = Fib()
    assert hasattr(x, '__next__'), \
        "Fib has no __next__ special method."
コード例 #5
0
def test_fib_next():
    x = Fib()
    assert hasattr(x, "__next__"), "Fib has no __next__ special method."