コード例 #1
0
ファイル: test_game.py プロジェクト: b2ag/server
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
コード例 #2
0
ファイル: test_game.py プロジェクト: yorick-ne/server
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
コード例 #3
0
ファイル: test_game.py プロジェクト: 46bit/faforever-server
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