-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: httpx.AsyncClient factory method to customize client
Argument `get_httpx_client` incorporated to `SSOBase` to allow customization of `httpx.AsyncClient` used to call auth provider
- Loading branch information
Showing
4 changed files
with
45 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,8 +151,8 @@ async def test_process_login(self, Provider: Type[SSOBase], monkeypatch: pytest. | |
async def fake_openid_from_response(_, __): | ||
return OpenID(id="test", email="[email protected]", display_name="Test") | ||
|
||
async with sso: | ||
monkeypatch.setattr("httpx.AsyncClient", FakeAsyncClient) | ||
with sso: | ||
monkeypatch.setattr(sso, "get_async_client", FakeAsyncClient) | ||
monkeypatch.setattr(sso, "openid_from_response", fake_openid_from_response) | ||
request = Request(url="https://localhost?code=code&state=unique") | ||
await sso.process_login("code", request) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters