Changeset View
Changeset View
Standalone View
Standalone View
swh/core/db/tests/test_cli.py
Show All 38 Lines | help_db_msg = """Usage: swh db [OPTIONS] COMMAND [ARGS]... | ||||
Software Heritage database generic tools. | Software Heritage database generic tools. | ||||
Options: | Options: | ||||
-C, --config-file FILE Configuration file. | -C, --config-file FILE Configuration file. | ||||
-h, --help Show this message and exit. | -h, --help Show this message and exit. | ||||
Commands: | Commands: | ||||
create Create a database for the Software Heritage <module>. | create Create a database for the Software Heritage <module>. | ||||
init Initialize a database for the Software Heritage <module>. | init Initialize a database for the Software Heritage <module>. | ||||
init-admin Execute superuser-level initialization steps (e.g pg | |||||
extensions,... | |||||
""" | """ | ||||
def test_swh_db_help(swhmain): | def test_swh_db_help(swhmain): | ||||
swhmain.add_command(swhdb) | swhmain.add_command(swhdb) | ||||
runner = CliRunner() | runner = CliRunner() | ||||
result = runner.invoke(swhmain, ["db", "-h"]) | result = runner.invoke(swhmain, ["db", "-h"]) | ||||
assert result.exit_code == 0 | assert result.exit_code == 0 | ||||
assert result.output == help_db_msg | assert result.output == help_db_msg |