mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-27 07:50:43 +02:00
Update OAuth callback tests to v2 AuthorizationCodeResult contract
This commit is contained in:
parent
8c9b1b6131
commit
2f9a63f092
1 changed files with 6 additions and 6 deletions
|
|
@ -66,16 +66,16 @@ class TestHeadlessOAuthCallbackHandler:
|
|||
oauth = self._make_oauth_with_redirect(
|
||||
"https://example.com/callback?code=abc&state="
|
||||
)
|
||||
auth_code, state = await oauth.callback_handler()
|
||||
assert auth_code == "abc"
|
||||
assert state == ""
|
||||
result = await oauth.callback_handler()
|
||||
assert result.code == "abc"
|
||||
assert result.state == ""
|
||||
|
||||
async def test_callback_returns_none_when_state_missing(self):
|
||||
"""A truly missing state still returns None (default)."""
|
||||
oauth = self._make_oauth_with_redirect("https://example.com/callback?code=abc")
|
||||
auth_code, state = await oauth.callback_handler()
|
||||
assert auth_code == "abc"
|
||||
assert state is None
|
||||
result = await oauth.callback_handler()
|
||||
assert result.code == "abc"
|
||||
assert result.state is None
|
||||
|
||||
async def test_callback_uses_blank_error_description_verbatim(self):
|
||||
"""When the OAuth provider sends an empty error_description, surface
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue