예제 #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()
예제 #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()
예제 #3
0
파일: test_db.py 프로젝트: petr-muller/vtes
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()
예제 #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()
예제 #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()
예제 #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
예제 #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
예제 #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
예제 #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