@@ -265,7 +265,7 @@ async def test_oauth_discovery_fallback_order(self, oauth_provider):
265
265
]
266
266
267
267
@pytest .mark .anyio
268
- async def test_oauth_discovery_fallback_conditions (self , oauth_provider ):
268
+ async def test_oauth_discovery_fallback_conditions (self , oauth_provider : OAuthClientProvider ):
269
269
"""Test the conditions during which an AS metadata discovery fallback will be attempted."""
270
270
# Ensure no tokens are stored
271
271
oauth_provider .context .current_tokens = None
@@ -349,7 +349,9 @@ async def test_oauth_discovery_fallback_conditions(self, oauth_provider):
349
349
)
350
350
351
351
# Mock the authorization process to minimize unnecessary state in this test
352
- oauth_provider ._perform_authorization = mock .AsyncMock (return_value = ("test_auth_code" , "test_code_verifier" ))
352
+ oauth_provider ._perform_authorization_code_grant = mock .AsyncMock (
353
+ return_value = ("test_auth_code" , "test_code_verifier" )
354
+ )
353
355
354
356
# Next request should fall back to legacy behavior and auth with the RS (mocked /authorize, next is /token)
355
357
token_request = await auth_flow .asend (oauth_metadata_response_3 )
@@ -662,7 +664,7 @@ async def test_auth_flow_with_valid_tokens(self, oauth_provider, mock_storage, v
662
664
pass # Expected
663
665
664
666
@pytest .mark .anyio
665
- async def test_auth_flow_with_no_tokens (self , oauth_provider , mock_storage ):
667
+ async def test_auth_flow_with_no_tokens (self , oauth_provider : OAuthClientProvider , mock_storage ):
666
668
"""Test auth flow when no tokens are available, triggering the full OAuth flow."""
667
669
# Ensure no tokens are stored
668
670
oauth_provider .context .current_tokens = None
@@ -731,7 +733,9 @@ async def test_auth_flow_with_no_tokens(self, oauth_provider, mock_storage):
731
733
)
732
734
733
735
# Mock the authorization process
734
- oauth_provider ._perform_authorization = mock .AsyncMock (return_value = ("test_auth_code" , "test_code_verifier" ))
736
+ oauth_provider ._perform_authorization_code_grant = mock .AsyncMock (
737
+ return_value = ("test_auth_code" , "test_code_verifier" )
738
+ )
735
739
736
740
# Next request should be to exchange token
737
741
token_request = await auth_flow .asend (registration_response )
0 commit comments