Esempio n. 1
0
 def test_set_frames(self):
     game = bowling_scorer.Game('')
     game.frames('X')
     assert game.frames == [10, 10, 10, 10, 10, 10, 10, 10, 10, 10]
Esempio n. 2
0
 def test_invalid_frame_results(self, rolls: str) -> None:
     game = bowling_scorer.Game('')
     with pytest.raises(bowling_scorer.InvalidRoll):
         for roll in rolls:
             game.add_roll(roll)
Esempio n. 3
0
 def test_invalid_roll_string(self, rolls: str) -> None:
     with pytest.raises(bowling_scorer.InvalidRoll):
         bowling_scorer.Game(rolls)
Esempio n. 4
0
 def test_valid_frame_results(self, rolls: str, frame_result: dict) -> None:
     game = bowling_scorer.Game('')
     for roll in rolls:
         game.add_roll(roll)
     assert game.frame_results == frame_result
Esempio n. 5
0
 def test_game(self, rolls: str, result: int) -> None:
     logger.debug(
         f'Game({rolls}) result: {bowling_scorer.Game(rolls).score}, expected: {result}'
     )
     assert bowling_scorer.Game(rolls).score == result