Exemplo n.º 1
0
def lobbyconnection(
    event_loop,
    database,
    mock_protocol,
    mock_games,
    mock_players,
    mock_player,
    mock_geoip,
    mock_nts_client
):
    lc = LobbyConnection(
        database=database,
        geoip=mock_geoip,
        game_service=mock_games,
        players=mock_players,
        nts_client=mock_nts_client,
        ladder_service=asynctest.create_autospec(LadderService)
    )

    lc.player = mock_player
    lc.protocol = mock_protocol
    lc.player_service.fetch_player_data = CoroutineMock()
    lc.peer_address = Address("127.0.0.1", 1234)
    lc._authenticated = True
    return lc
Exemplo n.º 2
0
def lobbyconnection(loop, mock_protocol, mock_games, mock_players, mock_player,
                    mock_geoip):
    lc = LobbyConnection(geoip=mock_geoip,
                         games=mock_games,
                         players=mock_players,
                         nts_client=mock_nts_client,
                         ladder_service=mock.create_autospec(LadderService))

    lc.player = mock_player
    lc.protocol = mock_protocol
    lc.player_service.get_permission_group.return_value = 0
    lc.player_service.fetch_player_data = CoroMock()
    lc.peer_address = Address('127.0.0.1', 1234)
    return lc