Skip to content
Snippets Groups Projects
Commit 66f66925 authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

Fix unit test

parent bce3c86a
No related branches found
No related tags found
1 merge request!293Retry image download
......@@ -587,13 +587,16 @@ def test_download_image_error_try_max(responses):
responses.GET,
fixed_url,
status=200,
body=next((FIXTURES / "prediction" / "images").iterdir()).read_bytes(),
)
image = download_image(url)
assert image
assert len(responses.calls) == 6
assert list(map(attrgetter("request.url"), responses.calls)) == [url] * 5 + [
# We try 3 times with the first URL
# Then the first try with the new URL is successful
assert len(responses.calls) == 4
assert list(map(attrgetter("request.url"), responses.calls)) == [url] * 3 + [
fixed_url
]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment