Ejemplo n.º 1
0
def test_command_simple():
    cmd = Command(name=NAME,
                  cmdtype=TYPE,
                  level=LEVEL,
                  description=DESCRIPTION)

    assert repr(cmd) == f"{NAME}: {DESCRIPTION}"
    assert str(
        cmd
    ) == f"Command[name={NAME}, type={TYPE}, level={LEVEL}, desc='{DESCRIPTION}']"
    assert cmd.to_csv("Toto") == f"Toto,{NAME},{TYPE},{LEVEL},{DESCRIPTION},\n"
Ejemplo n.º 2
0
def test_command_with_arguments():
    cmd = Command(name=NAME,
                  cmdtype=TYPE,
                  level=LEVEL,
                  description=DESCRIPTION,
                  args=[ARGUMENT])

    assert repr(cmd) == f"{NAME}: {DESCRIPTION}"
    assert str(
        cmd
    ) == f"Command[name={NAME}, type={TYPE}, level={LEVEL}, desc='{DESCRIPTION}', args=({repr(ARGUMENT)})]"
    assert cmd.to_csv(
        "Toto"
    ) == f"Toto,{NAME},{TYPE},{LEVEL},{DESCRIPTION},{repr(ARGUMENT)}\n"