mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-17 04:34:37 +03:00
Expect Cli.run not to exit on connection errors
This commit is contained in:
@@ -10,11 +10,8 @@ import aqt
|
||||
def test_cli_unknown_version(capsys):
|
||||
wrong_version = "5.16.0"
|
||||
wrong_url_ending = "mac_x64/desktop/qt5_5160/Updates.xml"
|
||||
with pytest.raises(SystemExit) as pytest_wrapped_e:
|
||||
cli = aqt.installer.Cli()
|
||||
cli.run(["install-qt", "mac", "desktop", wrong_version])
|
||||
assert pytest_wrapped_e.type == SystemExit
|
||||
assert pytest_wrapped_e.value.code == 1
|
||||
cli = aqt.installer.Cli()
|
||||
assert cli.run(["install-qt", "mac", "desktop", wrong_version]) == 1
|
||||
out, err = capsys.readouterr()
|
||||
sys.stdout.write(out)
|
||||
sys.stderr.write(err)
|
||||
|
||||
@@ -497,12 +497,9 @@ def test_install_bad_tools_modules(monkeypatch, capsys, cmd, xml_file, expected_
|
||||
monkeypatch.setattr("aqt.archives.getUrl", mock_get_url)
|
||||
monkeypatch.setattr("aqt.installer.getUrl", mock_get_url)
|
||||
|
||||
with pytest.raises(SystemExit) as pytest_wrapped_e:
|
||||
cli = Cli()
|
||||
cli._setup_settings()
|
||||
cli.run(cmd.split())
|
||||
assert pytest_wrapped_e.type == SystemExit
|
||||
assert pytest_wrapped_e.value.code == 1
|
||||
cli = Cli()
|
||||
cli._setup_settings()
|
||||
assert cli.run(cmd.split()) == 1
|
||||
|
||||
out, err = capsys.readouterr()
|
||||
match = expected_re.match(err)
|
||||
|
||||
Reference in New Issue
Block a user