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

Commit 2f15ab1

Browse files
committed
test: regression coverage for bug #111 (KeyError due to filename)
1 parent 748adb6 commit 2f15ab1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_apiproxy.py

+12
Original file line numberDiff line numberDiff line change
@@ -375,3 +375,15 @@ def test_download_get_sources_error_request_timeout(mocker):
375375
"headers": "foo"})))
376376
with pytest.raises(RequestTimeoutError):
377377
api.get_sources()
378+
379+
380+
def test_filename_key_not_in_download_response(mocker):
381+
api = API("mock", "mock", "mock", "mock", True)
382+
s = Submission(uuid="foobar")
383+
mocker.patch("sdclientapi.json_query",
384+
return_value=(
385+
json.dumps({"body": json.dumps({"error": "wah"}),
386+
"status": 200,
387+
"headers": "foo"})))
388+
with pytest.raises(BaseError):
389+
api.download_submission(s)

0 commit comments

Comments
 (0)