Пример #1
0
def test_strike_score_frame_next_zero_next():
    frames = [[10, 0], [1, 1], [0, 0]]  # 12, 2, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 14 == bowling_score
Пример #2
0
def test_spare_multiple_spares():
    frames = [[1, 9], [1, 9], [1, 9]]  # 11, 11, 10, 0x
    frames.append([0, 0] * 7)

    bowling_score = score(frames)

    assert 32 == bowling_score
Пример #3
0
def test_strike_zero_frame_next():
    frames = [[10, 0]]  # 10, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 10 == bowling_score
Пример #4
0
def test_spare_not_zero_next():
    frames = [[1, 9], [1, 0]]  # 11, 1, 0x
    frames.append([0, 0] * 8)

    bowling_score = score(frames)

    assert 12 == bowling_score
Пример #5
0
def test_spare_zero_next():
    frames = [[1, 9]]  # 10, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 10 == bowling_score
Пример #6
0
def test_score_one():
    frames = [[1, 0]]  # 1, 0x
    frames.append([0, 0] * 9)

    bowling_score = score(frames)

    assert 1 == bowling_score
Пример #7
0
def test_tenth_frame_no_strike_no_spare():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, 9
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [9, 0]]

    bowling_score = score(frames)

    assert 9 == bowling_score
Пример #8
0
def test_ninth_frame_strike_zero_next():
    # 0, 0, 0, 0, 0, 0, 0, 0, 10, 0
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [10, 0], [0, 0]]

    bowling_score = score(frames)

    assert 10 == bowling_score
Пример #9
0
def test_three_strikes_in_a_row():
    # 30, 20, 10
    frames = [[10, 0], [10, 0], [10, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 60 == bowling_score
Пример #10
0
def test_score_zeros():
    # 0x
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 0 == bowling_score
Пример #11
0
def test_strike_score_frame_next_score_next():
    # 22, 2, 10, 0x
    frames = [[10, 0], [1, 1], [1, 9], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 34 == bowling_score
Пример #12
0
def test_tenth_frame_spare():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 1
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [9, 1, 1]]

    bowling_score = score(frames)

    assert 12 == bowling_score
Пример #13
0
def test_tenth_frame_strike():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (12, 1, 1)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 1, 1]]

    bowling_score = score(frames)

    assert 14 == bowling_score
Пример #14
0
def test_strike_zero_frame_next():
    # 10, 0x
    frames = [[10, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 10 == bowling_score
Пример #15
0
def test_spare_multiple_spares():
    # 11, 11, 10, 0x
    frames = [[1, 9], [1, 9], [1, 9], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 32 == bowling_score
Пример #16
0
def test_all_spare_except_last_frame():
    # 11, 11, 11, 11, 11, 11, 11, 11, 10, 0
    frames = [[1, 9], [1, 9], [1, 9], [1, 9], [1, 9], [1, 9], [1, 9], [1, 9],
              [1, 9], [0, 0]]

    bowling_score = score(frames)

    assert 98 == bowling_score
Пример #17
0
def test_spare_zero_next():
    # 10, 0x
    frames = [[1, 9], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 10 == bowling_score
Пример #18
0
def test_spare_not_zero_next():
    # 11, 1, 0x
    frames = [[1, 9], [1, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 12 == bowling_score
Пример #19
0
def test_ten_strikes():
    # 1-30, 2-30, 3-30, 4-30, 5-30, 6-30, 7-30, 8-30, 9-20, 10-10
    frames = [[10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0],
              [10, 0], [10, 0], [10, 0, 0]]

    bowling_score = score(frames)

    assert 270 == bowling_score
Пример #20
0
def test_scores_no_strike_no_spare():
    # 9, 9, 9, 9, 9, 9, 9, 9, 9, 9
    frames = [[5, 4], [5, 4], [5, 4], [5, 4], [5, 4], [5, 4], [5, 4], [5, 4],
              [5, 4], [5, 4]]

    bowling_score = score(frames)

    assert 90 == bowling_score
Пример #21
0
def test_nine_strikes():
    # 1-30, 2-30, 3-30, 4-30, 5-30, 6-30, 7-30, 8-20, 9-10, 10-0
    frames = [[10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0],
              [10, 0], [10, 0], [0, 0]]

    bowling_score = score(frames)

    assert 240 == bowling_score
Пример #22
0
def test_eight_strikes():
    # 1-30, 2-30, 3-30, 4-30, 5-30, 6-30, 7-20, 8-10, 9-0, 10-0
    frames = [[10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0], [10, 0],
              [10, 0], [0, 0], [0, 0]]

    bowling_score = score(frames)

    assert 210 == bowling_score
Пример #23
0
def test_tenth_frame_strik_strike_strike():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (30, 20, 10)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 10, 10]]

    bowling_score = score(frames)

    assert 60 == bowling_score
Пример #24
0
def test_tenth_frame_strik_strike_zero():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (20, 10, 0)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 10, 0]]

    bowling_score = score(frames)

    assert 30 == bowling_score
Пример #25
0
def test_tenth_frame_strike_spare():
    # 0, 0, 0, 0, 0, 0, 0, 0, 0, (20, 9, 1)
    frames = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
              [0, 0], [10, 9, 1]]

    bowling_score = score(frames)

    assert 30 == bowling_score
Пример #26
0
def test_score_one():
    # 1, 0x
    frames = [
        [1, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
        [0, 0],
    ]

    bowling_score = score(frames)

    assert 1 == bowling_score
Пример #27
0
def test_score_zeros():
    frames = [[0, 0] * 10]  # 0x

    bowling_score = score(frames)

    assert 0 == bowling_score
Пример #28
0
def test_scores_no_strike_no_spare():
    frames = [[5, 4] * 10]  # 9, 9, 9, 9, 9, 9, 9, 9, 9, 9

    bowling_score = score(frames)

    assert 90 == bowling_score