Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kidev committed Jan 9, 2025
1 parent c13bbc2 commit 0790ad3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 0 additions & 2 deletions aqt/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1619,8 +1619,6 @@ def install(self) -> None:
self.logger.info(f"Downloading Qt installer to {installer_path}")
self._download_installer(installer_path)

self.logger.info("Starting Qt installation")

try:
cmd = self._get_install_command(installer_path)
safe_cmd = cmd.copy()
Expand Down
14 changes: 8 additions & 6 deletions tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2056,14 +2056,16 @@ def mock_get_url(url: str, *args, **kwargs) -> str:
assert expect_out.match(err), err


@pytest.mark.enable_socket
@pytest.mark.parametrize(
"cmd, arch_dict, details, expected_command",
[
(
"install-qt-commercial desktop {} 6.8.0 " "--outputdir ./install-qt-commercial " "--user {} --password {}",
"install-qt-commercial desktop {} 6.8.0 " "--outputdir /tmp/install-qt-commercial " "--user {} --password {}",
{"windows": "win64_msvc2022_64", "linux": "linux_gcc_64", "mac": "clang_64"},
["./install-qt-commercial", "qt6", "681"],
"qt-unified-{}-online.run --email ******** --pw ******** --root {} --accept-licenses --accept-obligations "
["/tmp/install-qt-commercial", "qt6", "680"],
"qt-unified-{}-x64-online.run --email ******** --pw ******** --root {} "
"--accept-licenses --accept-obligations "
"--confirm-command "
"--auto-answer OperationDoesNotExistError=Ignore,OverwriteTargetDirectory=No,"
"stopProcessesForUpdates=Cancel,installationErrorWithCancel=Cancel,installationErrorWithIgnore=Ignore,"
Expand All @@ -2079,12 +2081,12 @@ def test_install_qt_commercial(
arch = arch_dict[current_platform]

formatted_cmd = cmd.format(arch, "vofab76634@gholar.com", "WxK43TdWCTmxsrrpnsWbjPfPXVq3mtLK")
formatted_expected = expected_command.format(arch, *details, arch)
formatted_expected = expected_command.format(current_platform, *details, arch)

cli = Cli()
cli._setup_settings()

cli.run(formatted_cmd.split())

[out, _] = capsys.readouterr()
assert str(out).find(formatted_expected)
out = " ".join(capsys.readouterr())
assert str(out).find(formatted_expected) >= 0

0 comments on commit 0790ad3

Please sign in to comment.