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