@@ -195,51 +195,3 @@ async def test_get_agent_card(
195195
196196 assert response .name == sample_agent_card .name
197197 assert response .version == sample_agent_card .version
198-
199-
200- @pytest .mark .asyncio
201- async def test_abort_context_all_errors (
202- grpc_handler : GrpcHandler , mock_grpc_context : AsyncMock
203- ):
204- """Test that abort_context handles all defined error types."""
205- error_map = {
206- types .JSONParseError (): (grpc .StatusCode .INTERNAL , 'JSONParseError' ),
207- types .InvalidRequestError (): (
208- grpc .StatusCode .INVALID_ARGUMENT ,
209- 'InvalidRequestError' ,
210- ),
211- types .MethodNotFoundError (): (
212- grpc .StatusCode .NOT_FOUND ,
213- 'MethodNotFoundError' ,
214- ),
215- types .PushNotificationNotSupportedError (): (
216- grpc .StatusCode .UNIMPLEMENTED ,
217- 'PushNotificationNotSupportedError' ,
218- ),
219- types .UnsupportedOperationError (): (
220- grpc .StatusCode .UNIMPLEMENTED ,
221- 'UnsupportedOperationError' ,
222- ),
223- types .ContentTypeNotSupportedError (): (
224- grpc .StatusCode .UNIMPLEMENTED ,
225- 'ContentTypeNotSupportedError' ,
226- ),
227- types .InvalidAgentResponseError (): (
228- grpc .StatusCode .INTERNAL ,
229- 'InvalidAgentResponseError' ,
230- ),
231- types .InternalError (message = 'DB down' ): (
232- grpc .StatusCode .INTERNAL ,
233- 'InternalError: DB down' ,
234- ),
235- }
236-
237- for error_instance , (expected_code , expected_msg_part ) in error_map .items ():
238- mock_grpc_context .reset_mock ()
239- await grpc_handler .abort_context (
240- ServerError (error = error_instance ), mock_grpc_context
241- )
242- mock_grpc_context .abort .assert_awaited_once ()
243- args , _ = mock_grpc_context .abort .call_args
244- assert args [0 ] == expected_code
245- assert expected_msg_part in args [1 ]
0 commit comments