Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/tests/test_cli.py
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
def test_run_help(swh_config): | def test_run_help(swh_config): | ||||
"""Help message should be ok | """Help message should be ok | ||||
""" | """ | ||||
runner = CliRunner() | runner = CliRunner() | ||||
result = runner.invoke(run, ['-h']) | result = runner.invoke(run, ['-h']) | ||||
assert result.exit_code == 0 | assert result.exit_code == 0 | ||||
expected_help_msg = """Usage: run [OPTIONS] [archive|debian|deposit|npm|pypi] URL [OPTIONS]... | expected_help_msg = """Usage: run [OPTIONS] [archive|cran|debian|deposit|npm|pypi] URL [OPTIONS]... | ||||
Ingest with loader <type> the origin located at <url> | Ingest with loader <type> the origin located at <url> | ||||
Options: | Options: | ||||
-h, --help Show this message and exit. | -h, --help Show this message and exit. | ||||
""" # noqa | """ # noqa | ||||
assert result.output.startswith(expected_help_msg) | assert result.output.startswith(expected_help_msg) | ||||
Show All 12 Lines | |||||
def test_list_help(mocker, swh_config): | def test_list_help(mocker, swh_config): | ||||
"""Triggering a load should be ok | """Triggering a load should be ok | ||||
""" | """ | ||||
runner = CliRunner() | runner = CliRunner() | ||||
result = runner.invoke(list, ['--help']) | result = runner.invoke(list, ['--help']) | ||||
assert result.exit_code == 0 | assert result.exit_code == 0 | ||||
expected_help_msg = """Usage: list [OPTIONS] [[all|archive|debian|deposit|npm|pypi]] | expected_help_msg = """Usage: list [OPTIONS] [[all|archive|cran|debian|deposit|npm|pypi]] | ||||
List supported loaders and optionally their arguments | List supported loaders and optionally their arguments | ||||
Options: | Options: | ||||
-h, --help Show this message and exit. | -h, --help Show this message and exit. | ||||
""" # noqa | """ # noqa | ||||
assert result.output.startswith(expected_help_msg) | assert result.output.startswith(expected_help_msg) | ||||
Show All 12 Lines |