add help command

This commit is contained in:
2022-03-31 02:18:39 +03:00
parent fdcbcc4541
commit 8e6473d2a0
5 changed files with 132 additions and 3 deletions

View File

@ -65,6 +65,27 @@ def test_subparsers_aur_search_architecture(parser: argparse.ArgumentParser) ->
assert args.architecture == [""]
def test_subparsers_help(parser: argparse.ArgumentParser) -> None:
"""
help command must imply architecture list, lock, no-report, quiet, unsafe and parser
"""
args = parser.parse_args(["help"])
assert args.architecture == [""]
assert args.lock is None
assert args.no_report
assert args.quiet
assert args.unsafe
assert args.parser is not None and args.parser()
def test_subparsers_help_architecture(parser: argparse.ArgumentParser) -> None:
"""
help command must correctly parse architecture list
"""
args = parser.parse_args(["-a", "x86_64", "help"])
assert args.architecture == [""]
def test_subparsers_help_commands_unsafe(parser: argparse.ArgumentParser) -> None:
"""
help-commands-unsafe command must imply architecture list, lock, no-report, quiet, unsafe and parser
@ -80,7 +101,7 @@ def test_subparsers_help_commands_unsafe(parser: argparse.ArgumentParser) -> Non
def test_subparsers_help_commands_unsafe_architecture(parser: argparse.ArgumentParser) -> None:
"""
help-ommands-unsafe command must correctly parse architecture list
help-commands-unsafe command must correctly parse architecture list
"""
args = parser.parse_args(["-a", "x86_64", "help-commands-unsafe"])
assert args.architecture == [""]