def make_connection() -> LobbyConnection: return LobbyConnection(database=mock.Mock(), geoip=mock.Mock(), game_service=mock.Mock(), nts_client=mock.Mock(), players=mock.Mock(), ladder_service=mock.Mock())
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
def lobbyconnection(loop, mock_context, mock_protocol, mock_games, mock_players, mock_player): lc = LobbyConnection(loop, context=mock_context, games=mock_games, players=mock_players) lc.player = mock_player lc.connectivity = mock.create_autospec(Connectivity) lc.protocol = mock_protocol return lc
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