Skip to content

Commit

Permalink
#19: test(fix): fix API client for unit tests - add X-Request-Id he…
Browse files Browse the repository at this point in the history
…ader
  • Loading branch information
ReznikovRoman committed Jul 11, 2022
1 parent a9daf1a commit 9d113ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ class APIClient(TestClient):
def __init__(self, *args, **kwargs):
super(APIClient, self).__init__(*args, **kwargs)

async def _request(self, method: str, path: str, **kwargs: Any) -> ClientResponse:
headers = kwargs.pop("headers", {})
headers.update({"X-Request-Id": "XXX-XXX-XXX"})
return await super(APIClient, self)._request(method, path, headers=headers, **kwargs)

async def head(self, *args, **kwargs) -> APIResponse:
return await self._api_call("head", kwargs.get("expected_status_code", 200), *args, **kwargs)

Expand Down

0 comments on commit 9d113ed

Please sign in to comment.