Fix lint and tests

This commit is contained in:
Alexandre 'Kidev' Poumaroux
2025-03-22 13:47:34 +01:00
parent 4fdb75de3b
commit 0ada55c475
6 changed files with 83 additions and 95 deletions

View File

@@ -13,33 +13,10 @@ from aqt.metadata import MetadataFactory, SimpleSpec, Version
def expected_help(actual, prefix=None):
expected = (
"usage: aqt [-h] [-c CONFIG]\n"
" {install-qt,install-tool,install-qt-official,list-qt-official,install-doc,install-example,"
"install-src,list-qt,list-tool,list-doc,list-example,list-src,help,version}\n"
" ...\n"
"\n"
"Another unofficial Qt Installer.\n"
"aqt helps you install Qt SDK, tools, examples and others\n"
"\n"
"option",
" -h, --help show this help message and exit\n"
" -c CONFIG, --config CONFIG\n"
" Configuration ini file.\n"
"\n"
"subcommands:\n"
" aqt accepts several subcommands:\n"
" install-* subcommands are commands that install components\n"
" list-* subcommands are commands that show available components\n"
"\n"
" {install-qt,install-tool,install-qt-official,list-qt-official,install-doc,install-example,install-src,"
"list-qt,list-tool,list-doc,list-example,list-src,help,version}\n"
" Please refer to each help message by using '--help' "
"with each subcommand\n",
)
expected = "usage: aqt [-h] [-c CONFIG]"
if prefix is not None:
return actual.startswith(prefix + expected[0]) and actual.endswith(expected[1])
return actual.startswith(expected[0]) and actual.endswith(expected[1])
return actual.startswith(prefix + expected)
return actual.startswith(expected)
def test_cli_help(capsys):