示例#1
0
def test_positive_case():
    """Testing that sequence is fibonacci sequence"""
    assert check_fibonacci(
        [
            0,
            1,
            1,
            2,
            3,
            5,
            8,
            13,
            21,
            34,
            55,
            89,
            144,
            233,
            377,
            610,
            987,
            1597,
            2584,
            4181,
            6765,
        ]
    )
示例#2
0
def test_empty_list_case():
    """Testing that sequence with less than 3 elements will not pass"""
    assert not check_fibonacci([])
    assert not check_fibonacci([1])
示例#3
0
def test_fibonacci(value: Sequence[int], expected_result: bool):
    actual_result = check_fibonacci(value)

    assert actual_result == expected_result
示例#4
0
def test_positive_case():
    """Testing that fibonacci sequences give True."""
    assert check_fibonacci([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89])
示例#5
0
def test_empty_sequence():
    """Testing that empty sequence gives True."""
    assert check_fibonacci([])
示例#6
0
def test_two_elements_sequence():
    """Testing that sequences of two elements give correct result."""
    assert check_fibonacci([0, 1])
示例#7
0
def test_one_element_sequence():
    """Testing that sequences of 1 element give correct result."""
    assert not check_fibonacci("1")
示例#8
0
def test_positive_case2():
    """Testing that sequence given IS Fibonacci sequence(tuple given)"""
    assert check_fibonacci((144, 233, 377, 610, 987, 1597, 2584))
示例#9
0
def test_positive_case1():
    """Testing that sequence given IS actually Fibonacci sequence(list given)"""
    assert check_fibonacci([2, 3, 5, 8, 13, 21, 34, 55])
示例#10
0
def test_negative_case3():
    """Testing that sequence given IS NOT actually Fibonacci sequence(list given)"""
    assert not check_fibonacci([-14, -5, -19, -24])
示例#11
0
def test_negative_case2():
    """Testing that sequence given IS NOT actually Fibonacci sequence(list given)"""
    assert not check_fibonacci([16, 5, 21, 26])
示例#12
0
def test_negative_case1():
    """Testing that sequence given IS NOT actually Fibonacci sequence(list given)"""
    assert not check_fibonacci([2, 4, 6, 10])
示例#13
0
def test_positive_case4():
    """Testing that sequence given IS Fibonacci sequence(list given)"""
    assert check_fibonacci((1, 1))
示例#14
0
def test_positive_case3():
    """Testing that sequence given IS Fibonacci sequence(tuple given)"""
    assert check_fibonacci((0, 1))
示例#15
0
def test_negative_case():
    """Testing that sequence is not fibonacci sequence"""
    assert not check_fibonacci([0, 1, 1, 6])
示例#16
0
def test_negative_case():
    """Testing that not fibonacci sequences give False."""
    assert not check_fibonacci([0, 1, 1, 2, 3, 5, 8, 13, 22])
示例#17
0
def test_check_fibonacci(data: Sequence, expected_result: bool):
    actual_result = check_fibonacci(data)

    assert actual_result == expected_result