Пример #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