Beispiel #1
0
def log_game_with_decks_and_vp(tmpdir):
    points = (2, 0, 0, 1, 2)
    arguments = [
        f"{player}({deck}):{vp}"
        for player, deck, vp in zip(PLAYERS_5, DECKS_5, points)
    ]
    vtes_command(tmpdir).add().with_arguments(arguments).execute()
Beispiel #2
0
def log_game_with_vp(tmpdir, count, winning):
    count = int(count)
    winning = int(winning)

    points = [0] * count
    points[winning] = count
    players = [f"player_{x}:{points[x]}" for x in range(count)]
    vtes_command(tmpdir).add().with_arguments(players).execute()
Beispiel #3
0
def log_game_with_ml_namespace(tmpdir):
    arguments = [
        f"{player}({deck})" for player, deck in zip(PLAYERS_5, DECKS_5)
    ]
    vtes_command(tmpdir).with_database() \
                        .add() \
                        .with_arguments(arguments) \
                        .namespace("name/spa/ce") \
                        .execute() \
                        .assert_ok()
Beispiel #4
0
def log_games_with_diff_namespaces(tmpdir):
    arguments = [
        f"{player}({deck}):{points}"
        for player, deck, points in zip(PLAYERS_5, DECKS_5, POINTS_5)
    ]
    vtes_command(tmpdir).add().with_arguments(arguments).namespace(
        "different/spa/ce").execute()
    vtes_command(tmpdir).add().with_arguments(arguments).namespace(
        "different/name/ce").execute()
    vtes_command(tmpdir).add().with_arguments(arguments).execute()
Beispiel #5
0
def log_game_with_namespace(tmpdir):
    arguments = [
        f"{player}({deck})" for player, deck in zip(PLAYERS_5, DECKS_5)
    ]
    vtes_command(tmpdir).add().with_arguments(arguments).namespace(
        "namespace").execute()
Beispiel #6
0
def log_some_games(tmpdir, five_games):
    for game in five_games:
        command = vtes_command(tmpdir).add().with_arguments(game).execute()
        assert command.completed.returncode == 0
Beispiel #7
0
def game_namespace_is_changed(tmpdir):
    command = vtes_command(tmpdir).games().execute()

    output = [line for line in command.completed.stdout.split("\n") if line]
    assert output[1] == "1: Felipe (Deck) \u25b6 Afri (Deck) \u25b6 XZealot (Deck) 2VP \u25b6 Cooper (Deck) 2VP | name/space/1"  # pylint: disable=line-too-long
Beispiel #8
0
def game_is_changed(tmpdir):
    command = vtes_command(tmpdir).games().execute()

    output = [line for line in command.completed.stdout.split("\n") if line]
    assert output[1] == "1: Felipe (dECK) \u25b6 aFRI (Deck) \u25b6 XZealot (Deck) 3VP GW \u25b6 Cooper (Deck) 1VP"  # pylint: disable=line-too-long
Beispiel #9
0
def log_five_games(tmpdir):
    command = vtes_command(tmpdir).add().with_arguments(
        ("one", "two", "three", "four", "five"))
    for _ in range(5):
        command.execute()
        assert command.completed.returncode == 0