How to use the tomodachi.cli.CLI function in tomodachi

To help you get started, we’ve selected a few tomodachi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kalaspuff / tomodachi / tests / test_cli.py View on Github external
def test_cli_version_command_method(capsys: Any) -> None:
    cli = tomodachi.cli.CLI()
    with pytest.raises(SystemExit):
        cli.version_command()
    out, err = capsys.readouterr()
    assert err == ''
    assert out == 'tomodachi/{}'.format(tomodachi.__version__) + "\n"
github kalaspuff / tomodachi / tests / test_cli.py View on Github external
def test_cli_entrypoint_invalid_arguments_show_help(monkeypatch: Any, capsys: Any) -> None:
    cli = tomodachi.cli.CLI()
    monkeypatch.setattr(logging.root, 'handlers', [])

    with pytest.raises(SystemExit):
        tomodachi.cli.cli_entrypoint(['tomodachi', '--invalid'])

    out, err = capsys.readouterr()
    assert err == ''
    assert out == cli.help_command_usage() + "\n"
github kalaspuff / tomodachi / tests / test_cli.py View on Github external
def test_cli_help_command_method(capsys: Any) -> None:
    cli = tomodachi.cli.CLI()
    with pytest.raises(SystemExit):
        cli.help_command()
    out, err = capsys.readouterr()
    assert err == ''
    assert out == cli.help_command_usage() + "\n"
github kalaspuff / tomodachi / tests / test_cli.py View on Github external
def test_cli_entrypoint_invalid_subcommand_show_help(monkeypatch: Any, capsys: Any) -> None:
    cli = tomodachi.cli.CLI()
    monkeypatch.setattr(logging.root, 'handlers', [])

    with pytest.raises(SystemExit):
        tomodachi.cli.cli_entrypoint(['tomodachi', 'invalidsubcommand'])

    out, err = capsys.readouterr()
    assert err == ''
    assert out == cli.help_command_usage() + "\n"
github kalaspuff / tomodachi / tests / test_cli.py View on Github external
def test_cli_entrypoint_no_arguments(monkeypatch: Any, capsys: Any) -> None:
    cli = tomodachi.cli.CLI()
    monkeypatch.setattr(logging.root, 'handlers', [])

    with pytest.raises(SystemExit):
        tomodachi.cli.cli_entrypoint()

    out, err = capsys.readouterr()
    assert err == ''
    assert out == cli.help_command_usage() + "\n"
github kalaspuff / tomodachi / tests / test_cli.py View on Github external
def test_cli_entrypoint_print_help(monkeypatch: Any, capsys: Any) -> None:
    cli = tomodachi.cli.CLI()
    monkeypatch.setattr(logging.root, 'handlers', [])

    with pytest.raises(SystemExit):
        tomodachi.cli.cli_entrypoint(['tomodachi', '-h'])

    out, err = capsys.readouterr()
    assert err == ''
    assert out == cli.help_command_usage() + "\n"
github kalaspuff / tomodachi / tests / test_cli.py View on Github external
def test_cli_run_command_method_no_args(capsys: Any) -> None:
    cli = tomodachi.cli.CLI()
    with pytest.raises(SystemExit):
        cli.run_command([])
    out, err = capsys.readouterr()
    assert err == ''
    assert out == cli.run_command_usage() + "\n"