async def test_game_subscription(lobbyconnection: LobbyConnection): game = Mock() game.handle_action = CoroMock() lobbyconnection.game_connection = game lobbyconnection.ensure_authenticated = lambda _: True await lobbyconnection.on_message_received({'command': 'test', 'args': ['foo', 42], 'target': 'game'}) game.handle_action.assert_called_with('test', ['foo', 42])
async def test_game_subscription(lobbyconnection: LobbyConnection): game = Mock() game.handle_action = CoroutineMock() lobbyconnection.game_connection = game await lobbyconnection.on_message_received({ "command": "test", "args": ["foo", 42], "target": "game" }) game.handle_action.assert_called_with("test", ["foo", 42])