async def test_initialized_game_not_allowed_to_end(game: Game): await game.clear_data() game.state = GameState.INITIALIZING game.on_game_end() assert game.state is GameState.INITIALIZING
async def test_initialized_game_not_allowed_to_end(game: Game): await game.clear_data() game.state = GameState.INITIALIZING game.on_game_end() assert game.state is GameState.INITIALIZING
async def test_game_end_when_no_more_connections(game: Game, mock_game_connection): game.state = GameState.LOBBY game.on_game_end = CoroMock() mock_game_connection.state = GameConnectionState.CONNECTED_TO_HOST game.add_game_connection(mock_game_connection) await game.remove_game_connection(mock_game_connection) game.on_game_end.assert_any_call()
async def test_game_end_when_no_more_connections(game: Game, mock_game_connection): game.state = GameState.LOBBY game.on_game_end = CoroMock() mock_game_connection.state = GameConnectionState.CONNECTED_TO_HOST game.add_game_connection(mock_game_connection) await game.remove_game_connection(mock_game_connection) game.on_game_end.assert_any_call()