Skip to content

Commit

Permalink
Merge branch 'master' into arrayful_json
Browse files Browse the repository at this point in the history
  • Loading branch information
kratsg authored Oct 18, 2021
2 parents 3eacd1e + fb3a727 commit 16393e1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/test_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 16393e1

Please sign in to comment.