Skip to content

Commit 1ba3701

Browse files
committed
refactor: test: update cases and expectations
Signed-off-by: Hiroshi Miura <[email protected]>
1 parent 74fa9d9 commit 1ba3701

File tree

3 files changed

+4
-51
lines changed

3 files changed

+4
-51
lines changed

aqt/installer.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,7 @@ def __init__(self):
166166
title="subcommands",
167167
description="aqt accepts several subcommands:\n"
168168
"install-* subcommands are commands that install components\n"
169-
"list-* subcommands are commands that show available components\n\n"
170-
"commands {install|tool|src|examples|doc} are deprecated and marked for removal\n",
169+
"list-* subcommands are commands that show available components\n",
171170
help="Please refer to each help message by using '--help' with each subcommand",
172171
)
173172
self._make_all_parsers(subparsers)

tests/test_cli.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ def expected_help(actual, prefix=None):
1616
expected = (
1717
"usage: aqt [-h] [-c CONFIG]\n"
1818
" {install-qt,install-tool,install-doc,install-example,install-src,"
19-
"list-qt,list-tool,list-doc,list-example,list-src,"
20-
"install,tool,doc,examples,src,help,version}\n"
19+
"list-qt,list-tool,list-doc,list-example,list-src,help,version}\n"
2120
" ...\n"
2221
"\n"
2322
"Another unofficial Qt Installer.\n"
@@ -32,13 +31,9 @@ def expected_help(actual, prefix=None):
3231
" aqt accepts several subcommands:\n"
3332
" install-* subcommands are commands that install components\n"
3433
" list-* subcommands are commands that show available components\n"
35-
" \n"
36-
" commands {install|tool|src|examples|doc} are deprecated and marked for "
37-
"removal\n"
3834
"\n"
3935
" {install-qt,install-tool,install-doc,install-example,install-src,list-qt,"
40-
"list-tool,list-doc,list-example,list-src,"
41-
"install,tool,doc,examples,src,help,version}\n"
36+
"list-tool,list-doc,list-example,list-src,help,version}\n"
4237
" Please refer to each help message by using '--help' "
4338
"with each subcommand\n",
4439
)
@@ -110,14 +105,12 @@ def test_cli_invalid_version(capsys, invalid_version):
110105
cli._setup_settings()
111106

112107
matcher = re.compile(
113-
r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n"
108+
# r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n"
114109
r"(.*\n)*"
115110
r"ERROR :.*Invalid version: '" + invalid_version + r"'! Please use the form '5\.X\.Y'\.\n.*"
116111
)
117112

118113
for cmd in (
119-
("install", invalid_version, "mac", "desktop"),
120-
("doc", invalid_version, "mac", "desktop"),
121114
("list-qt", "mac", "desktop", "--arch", invalid_version),
122115
):
123116
cli = Cli()

tests/test_install.py

-39
Original file line numberDiff line numberDiff line change
@@ -354,45 +354,6 @@ def tool_archive(host: str, tool_name: str, variant: str, date: datetime = datet
354354
r"INFO : Time elapsed: .* second"
355355
),
356356
),
357-
(
358-
"tool linux tools_qtcreator 1.2.3-0-197001020304 qt.tools.qtcreator".split(),
359-
"linux",
360-
"desktop",
361-
"1.2.3",
362-
{"std": ""},
363-
{"std": ""},
364-
{"std": "linux_x64/desktop/tools_qtcreator/Updates.xml"},
365-
{"std": [tool_archive("linux", "tools_qtcreator", "qt.tools.qtcreator", datetime(1970, 1, 2, 3, 4, 5, 6))]},
366-
re.compile(
367-
r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n"
368-
r"WARNING : The command 'tool' is deprecated and marked for removal in a future version of aqt.\n"
369-
r"In the future, please use the command 'install-tool' instead.\n"
370-
r"INFO : Downloading qt.tools.qtcreator...\n"
371-
r"Finished installation of tools_qtcreator-linux-qt.tools.qtcreator.7z in .*\n"
372-
r"INFO : Finished installation\n"
373-
r"INFO : Time elapsed: .* second"
374-
),
375-
),
376-
(
377-
"install 5.14.0 windows desktop win32_mingw73".split(),
378-
"windows",
379-
"desktop",
380-
"5.14.0",
381-
{"std": "win32_mingw73"},
382-
{"std": "mingw73_32"},
383-
{"std": "windows_x86/desktop/qt5_5140/Updates.xml"},
384-
{"std": [plain_qtbase_archive("qt.qt5.5140.win32_mingw73", "win32_mingw73")]},
385-
re.compile(
386-
r"^INFO : aqtinstall\(aqt\) v.* on Python 3.*\n"
387-
r"WARNING : The command 'install' is deprecated"
388-
r" and marked for removal in a future version of aqt.\n"
389-
r"In the future, please use the command 'install-qt' instead.\n"
390-
r"INFO : Downloading qtbase...\n"
391-
r"Finished installation of qtbase-windows-win32_mingw73.7z in .*\n"
392-
r"INFO : Finished installation\n"
393-
r"INFO : Time elapsed: .* second"
394-
),
395-
),
396357
( # Mixing --modules with --archives
397358
"install-qt windows desktop 5.14.0 win32_mingw73 -m qtcharts --archives qtbase".split(),
398359
"windows",

0 commit comments

Comments
 (0)