test: cli: Update test expectation

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2021-08-01 15:54:54 +09:00
parent 0435bfd1b6
commit 59b8522cd2
2 changed files with 46 additions and 59 deletions

View File

@@ -11,9 +11,12 @@ def test_cli_help(capsys):
expected = "".join(
[
"usage: aqt [-h] [-c CONFIG]\n",
" {install,doc,examples,src,tool,list-qt,list-tool,help,version} ...\n",
" {install-qt,install-tool,install-doc,install-example,install-src,list-qt,list-tool,",
"install,tool,doc,example,src,help,version}\n",
" ...\n",
"\n",
"Installer for Qt SDK.\n",
"Another unoffical Qt Installer.\n",
"aqt help you install Qt SDK, tools, examples and others\n",
"\n",
"optional arguments:\n",
" -h, --help show this help message and exit\n",
@@ -21,10 +24,15 @@ def test_cli_help(capsys):
" Configuration ini file.\n",
"\n",
"subcommands:\n",
" Valid subcommands\n",
" aqt accept several subcommands\n",
" install-* subcommands are installer of components\n",
" list-* subcommands are show available compoenets\n",
" \n",
" commands {install|tool|src|examples|doc} are oblesolete now\n",
"\n",
" {install,doc,examples,src,tool,list-qt,list-tool,help,version}\n",
" subcommand for aqt Qt installer\n",
" {install-qt,install-tool,install-doc,install-example,install-src,list-qt,list-tool,",
"install,tool,doc,example,src,help,version}\n",
" Please refer each help message shown with --help argument for each subcommands\n",
]
)
cli = Cli()
@@ -79,8 +87,8 @@ def test_cli_invalid_version(capsys, invalid_version):
)
for cmd in (
("install", invalid_version, "mac", "desktop"),
("doc", invalid_version, "mac", "desktop"),
("install-qt", invalid_version, "mac", "desktop"),
("install-doc", invalid_version, "mac", "desktop"),
("list-qt", "mac", "desktop", "--modules", invalid_version),
):
with pytest.raises(SystemExit) as pytest_wrapped_e:
@@ -102,29 +110,3 @@ def test_cli_check_mirror():
args = cli.parser.parse_args(arg)
assert args.base == "https://download.qt.io/"
assert cli._check_mirror(args.base)
def test_cli_launch_with_no_argument(capsys):
expected = "".join(
[
"usage: aqt [-h] [-c CONFIG]\n",
" {install,doc,examples,src,tool,list-qt,list-tool,help,version} ...\n",
"\n",
"Installer for Qt SDK.\n",
"\n",
"optional arguments:\n",
" -h, --help show this help message and exit\n",
" -c CONFIG, --config CONFIG\n",
" Configuration ini file.\n",
"\n",
"subcommands:\n",
" Valid subcommands\n",
"\n",
" {install,doc,examples,src,tool,list-qt,list-tool,help,version}\n",
" subcommand for aqt Qt installer\n",
]
)
cli = Cli()
cli.run([])
out, err = capsys.readouterr()
assert out == expected