mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-17 20:54:38 +03:00
Fix error when no patchlevel version number exist
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
@@ -107,13 +107,10 @@ class Cli():
|
||||
def _check_modules_arg(self, qt_version, modules):
|
||||
if modules is None:
|
||||
return True
|
||||
result = True
|
||||
available = self.settings.available_modules(qt_version)
|
||||
for m in modules:
|
||||
if m not in available:
|
||||
result = False
|
||||
break
|
||||
return result
|
||||
if available is None:
|
||||
return False
|
||||
return all([m in available for m in modules])
|
||||
|
||||
def run_install(self, args):
|
||||
arch = args.arch
|
||||
|
||||
@@ -74,8 +74,8 @@ class Settings(object):
|
||||
:rtype: List[str]
|
||||
"""
|
||||
modules = self._combinations['modules']
|
||||
major, minor, _ = qt_version.split('.')
|
||||
version = "{}.{}".format(major, minor)
|
||||
versions = qt_version.split('.')
|
||||
version = "{}.{}".format(versions[0], versions[1])
|
||||
result = None
|
||||
for record in modules:
|
||||
if record["qt_version"] == version:
|
||||
|
||||
@@ -24,3 +24,11 @@ def test_cli_help(capsys):
|
||||
cli.run(["help"])
|
||||
out, err = capsys.readouterr()
|
||||
assert out == expected
|
||||
|
||||
|
||||
def test_cli_check_module():
|
||||
cli = aqt.cli.Cli()
|
||||
assert cli._check_modules_arg('5.11.3', ['qtcharts', 'qtwebengine'])
|
||||
assert not cli._check_modules_arg('5.7', ['not_exist'])
|
||||
assert cli._check_modules_arg('5.14.0', None)
|
||||
assert not cli._check_modules_arg('5.15.0', ["Unknown"])
|
||||
|
||||
Reference in New Issue
Block a user