diff --git a/tests/test_scripts.py b/tests/test_scripts.py index 601e289caa..ad7bfe5add 100644 --- a/tests/test_scripts.py +++ b/tests/test_scripts.py @@ -553,19 +553,18 @@ def test_patchset_download(tmpdir, script_runner, archive): ret = script_runner.run(*shlex.split(command)) assert ret.success - command = f'pyhf contrib download --verbose https://www.fail.org/record/resource/1234567 {tmpdir.join("likelihoods").strpath}' + command = f'pyhf contrib download --verbose https://www.pyhfthisdoesnotexist.org/record/resource/1234567 {tmpdir.join("likelihoods").strpath}' ret = script_runner.run(*shlex.split(command)) assert not ret.success assert ( - "pyhf.exceptions.InvalidArchiveHost: www.fail.org is not an approved archive host" + "pyhf.exceptions.InvalidArchiveHost: www.pyhfthisdoesnotexist.org is not an approved archive host" in ret.stderr ) - command = f'pyhf contrib download --verbose --force https://www.fail.org/record/resource/1234567 {tmpdir.join("likelihoods").strpath}' + # Force a download from a real URL, but one that doesn't have an existing file + command = f'pyhf contrib download --verbose --force https://httpstat.us/404/record/resource/1234567 {tmpdir.join("likelihoods").strpath}' ret = script_runner.run(*shlex.split(command)) assert not ret.success - assert ( - "SSLCertificateError" and "hostname 'www.fail.org' doesn't match" in ret.stderr - ) + assert "tarfile.ReadError: not a gzip file" in ret.stderr def test_missing_contrib_extra(caplog):