2018-07-11 08:50:42 -04:00
|
|
|
"""Test help"""
|
2020-12-21 17:53:44 -05:00
|
|
|
import pytest
|
2018-07-11 08:50:42 -04:00
|
|
|
|
|
|
|
|
2020-11-17 15:38:31 -05:00
|
|
|
def test_missing_command(runner, yadm_cmd):
|
2018-07-11 08:50:42 -04:00
|
|
|
"""Run without any command"""
|
2020-11-17 15:38:31 -05:00
|
|
|
run = runner(command=yadm_cmd())
|
2018-07-11 08:50:42 -04:00
|
|
|
assert run.failure
|
2023-07-10 15:43:17 -04:00
|
|
|
assert run.err == ""
|
|
|
|
assert run.out.startswith("Usage: yadm")
|
2018-07-11 08:50:42 -04:00
|
|
|
|
|
|
|
|
2023-07-10 15:43:17 -04:00
|
|
|
@pytest.mark.parametrize("cmd", ["--help", "help"])
|
2020-12-21 17:53:44 -05:00
|
|
|
def test_help_command(runner, yadm_cmd, cmd):
|
2018-07-11 08:50:42 -04:00
|
|
|
"""Run with help command"""
|
2020-12-21 17:53:44 -05:00
|
|
|
run = runner(command=yadm_cmd(cmd))
|
2018-07-11 08:50:42 -04:00
|
|
|
assert run.failure
|
2023-07-10 15:43:17 -04:00
|
|
|
assert run.err == ""
|
|
|
|
assert run.out.startswith("Usage: yadm")
|