Skip to content
This repository has been archived by the owner on Jan 7, 2024. It is now read-only.

Commit

Permalink
test: regression coverage for bug #111 (KeyError due to filename)
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Feb 11, 2020
1 parent 748adb6 commit 2f15ab1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_apiproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,15 @@ def test_download_get_sources_error_request_timeout(mocker):
"headers": "foo"})))
with pytest.raises(RequestTimeoutError):
api.get_sources()


def test_filename_key_not_in_download_response(mocker):
api = API("mock", "mock", "mock", "mock", True)
s = Submission(uuid="foobar")
mocker.patch("sdclientapi.json_query",
return_value=(
json.dumps({"body": json.dumps({"error": "wah"}),
"status": 200,
"headers": "foo"})))
with pytest.raises(BaseError):
api.download_submission(s)

0 comments on commit 2f15ab1

Please sign in to comment.