Exemple #1
0
async def test_clear_slot(game: Game, game_connection: GameConnection):
    game.state = GameState.LOBBY
    players = [
        Player(id=1, login='******', global_rating=(1500, 500)),
        Player(id=2, login='******', global_rating=(1500, 500))
    ]
    add_connected_players(game, players)

    game.clear_slot(0)

    assert game.get_player_option(1, 'StartSpot') == -1
    assert game.get_player_option(1, 'Team') == -1
    assert game.get_player_option(1, 'Army') == -1
    assert game.get_player_option(2, 'StartSpot') == 1
Exemple #2
0
async def test_clear_slot(game: Game, game_connection: GameConnection):
    game.state = GameState.LOBBY
    players = [
        Player(id=1, login='******', global_rating=(1500, 500)),
        Player(id=2, login='******', global_rating=(1500, 500))
    ]
    add_connected_players(game, players)

    game.clear_slot(0)

    assert game.get_player_option(1, 'StartSpot') == -1
    assert game.get_player_option(1, 'Team') == -1
    assert game.get_player_option(1, 'Army') == -1
    assert game.get_player_option(2, 'StartSpot') == 1
Exemple #3
0
async def test_clear_slot(game: Game, mock_game_connection: GameConnection,
                          player_factory):
    game.state = GameState.LOBBY
    players = [
        player_factory("Dostya", player_id=1, global_rating=(1500, 500)),
        player_factory("Rhiza", player_id=2, global_rating=(1500, 500))
    ]
    add_connected_players(game, players)
    game.set_ai_option('rush', 'StartSpot', 3)

    game.clear_slot(0)
    game.clear_slot(3)

    assert game.get_player_option(1, 'StartSpot') == -1
    assert game.get_player_option(1, 'Team') == -1
    assert game.get_player_option(1, 'Army') == -1
    assert game.get_player_option(2, 'StartSpot') == 1
    assert 'rush' not in game.AIs
Exemple #4
0
def test_invalid_get_player_option_key(game: Game, players):
    assert game.get_player_option(players.hosting.id, -1) is None
Exemple #5
0
def test_invalid_get_player_option_key(game: Game, players):
    assert game.get_player_option(players.hosting.id, -1) is None