-
-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
55 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ concurrency: 3 | |
blacklist: | ||
http://mirror.example.com | ||
http://mirrors.geekpie.club | ||
|
||
[authentication] | ||
user: [email protected] | ||
password: WxK43TdWCTmxsrrpnsWbjPfPXVq3mtLK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2054,3 +2054,47 @@ def mock_get_url(url: str, *args, **kwargs) -> str: | |
sys.stderr.write(err) | ||
|
||
assert expect_out.match(err), err | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"cmd, arch_dict, details, expected_command", | ||
[ | ||
( | ||
"install-qt-commercial desktop {} 6.8.0 " | ||
"--outputdir ./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 --root {} --accept-licenses --accept-obligations --confirm-command " | ||
"--auto-answer OperationDoesNotExistError=Ignore,OverwriteTargetDirectory=No," | ||
"stopProcessesForUpdates=Cancel,installationErrorWithCancel=Cancel,installationErrorWithIgnore=Ignore," | ||
"AssociateCommonFiletypes=Yes,telemetry-question=No install qt.{}.{}.{}", | ||
), | ||
], | ||
) | ||
def test_install_qt_commercial( | ||
capsys, monkeypatch, cmd: str, arch_dict: dict[str, str], details: list[str], expected_command: str | ||
) -> None: | ||
"""Test commercial Qt installation command""" | ||
current_platform = sys.platform.lower() | ||
arch = arch_dict[current_platform] | ||
|
||
formatted_cmd = cmd.format(arch, "[email protected]", "WxK43TdWCTmxsrrpnsWbjPfPXVq3mtLK") | ||
formatted_expected = expected_command.format(arch, *details, arch) | ||
|
||
cli = Cli() | ||
cli._setup_settings() | ||
|
||
def mock_exists(*args, **kwargs): | ||
return False | ||
|
||
def mock_subprocess(*args, **kwargs): | ||
return 0 | ||
|
||
monkeypatch.setattr(Path, "exists", mock_exists) | ||
monkeypatch.setattr("subprocess.check_call", mock_subprocess) | ||
|
||
cli.run(formatted_cmd.split()) | ||
|
||
[out, _] = capsys.readouterr() | ||
assert str(out).find(formatted_expected) |