Skip to content
Snippets Groups Projects
Commit 0365671c authored by Manon Blanco's avatar Manon Blanco Committed by Manon Blanco
Browse files

Test `arkindex.client.ArkindexClient.request`

parent 47696d05
No related branches found
No related tags found
1 merge request!237Test `arkindex.client.ArkindexClient.request`
Pipeline #174980 passed
# -*- coding: utf-8 -*-
import pytest
from apistar.exceptions import ErrorResponse
def test_request_no_more_retries(responses, dummy_client):
# First call is an error
responses.add(
responses.POST,
"https://dummy.test/api/v1/user/login/",
status=502,
)
dummy_client.request.retry.wait = 0
# There should be 5 retries
max_retries = 5
with pytest.raises(ErrorResponse):
dummy_client.login("user@user.user", "Pa$$w0rd")
assert len(responses.calls) == max_retries
assert [call.request.url for call in responses.calls] == [
"https://dummy.test/api/v1/user/login/",
] * max_retries
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