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]
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)
def test_invalid_roll_string(self, rolls: str) -> None: with pytest.raises(bowling_scorer.InvalidRoll): bowling_scorer.Game(rolls)
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
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