@@ -106,10 +106,10 @@ def store():
106106
107107
108108@pytest .mark .asyncio
109- async def test_auth_interceptor_skips_when_no_agent_card (store ):
110- """
111- Tests that the AuthInterceptor does not modify the request when no AgentCard is provided.
112- """
109+ async def test_auth_interceptor_skips_when_no_agent_card (
110+ store : InMemoryContextCredentialStore ,
111+ ) -> None :
112+ """Tests that the AuthInterceptor does not modify the request when no AgentCard is provided."""
113113 request_payload = {'foo' : 'bar' }
114114 http_kwargs = {'fizz' : 'buzz' }
115115 auth_interceptor = AuthInterceptor (credential_service = store )
@@ -126,9 +126,10 @@ async def test_auth_interceptor_skips_when_no_agent_card(store):
126126
127127
128128@pytest .mark .asyncio
129- async def test_in_memory_context_credential_store (store ):
130- """
131- Verifies that InMemoryContextCredentialStore correctly stores and retrieves
129+ async def test_in_memory_context_credential_store (
130+ store : InMemoryContextCredentialStore ,
131+ ) -> None :
132+ """Verifies that InMemoryContextCredentialStore correctly stores and retrieves
132133 credentials based on the session ID in the client context.
133134 """
134135 session_id = 'session-id'
@@ -163,11 +164,8 @@ async def test_in_memory_context_credential_store(store):
163164
164165@pytest .mark .asyncio
165166@respx .mock
166- async def test_client_with_simple_interceptor ():
167- """
168- Ensures that a custom HeaderInterceptor correctly injects a static header
169- into outbound HTTP requests from the A2AClient.
170- """
167+ async def test_client_with_simple_interceptor () -> None :
168+ """Ensures that a custom HeaderInterceptor correctly injects a static header into outbound HTTP requests from the A2AClient."""
171169 url = 'http://agent.com/rpc'
172170 interceptor = HeaderInterceptor ('X-Test-Header' , 'Test-Value-123' )
173171 card = AgentCard (
@@ -196,9 +194,7 @@ async def test_client_with_simple_interceptor():
196194
197195@dataclass
198196class AuthTestCase :
199- """
200- Represents a test scenario for verifying authentication behavior in AuthInterceptor.
201- """
197+ """Represents a test scenario for verifying authentication behavior in AuthInterceptor."""
202198
203199 url : str
204200 """The endpoint URL of the agent to which the request is sent."""
@@ -284,11 +280,10 @@ class AuthTestCase:
284280 [api_key_test_case , oauth2_test_case , oidc_test_case , bearer_test_case ],
285281)
286282@respx .mock
287- async def test_auth_interceptor_variants (test_case , store ):
288- """
289- Parametrized test verifying that AuthInterceptor correctly attaches credentials
290- based on the defined security scheme in the AgentCard.
291- """
283+ async def test_auth_interceptor_variants (
284+ test_case : AuthTestCase , store : InMemoryContextCredentialStore
285+ ) -> None :
286+ """Parametrized test verifying that AuthInterceptor correctly attaches credentials based on the defined security scheme in the AgentCard."""
292287 await store .set_credentials (
293288 test_case .session_id , test_case .scheme_name , test_case .credential
294289 )
@@ -329,12 +324,9 @@ async def test_auth_interceptor_variants(test_case, store):
329324
330325@pytest .mark .asyncio
331326async def test_auth_interceptor_skips_when_scheme_not_in_security_schemes (
332- store ,
333- ):
334- """
335- Tests that AuthInterceptor skips a scheme if it's listed in security requirements
336- but not defined in security_schemes.
337- """
327+ store : InMemoryContextCredentialStore ,
328+ ) -> None :
329+ """Tests that AuthInterceptor skips a scheme if it's listed in security requirements but not defined in security_schemes."""
338330 scheme_name = 'missing'
339331 session_id = 'session-id'
340332 credential = 'dummy-token'
0 commit comments