@@ -898,38 +898,6 @@ async def test_send_message_with_extensions(
898898 expected_extensions = {'test_extension_1' , 'test_extension_2' }
899899 assert actual_extensions == expected_extensions
900900
901- @pytest .mark .asyncio
902- async def test_send_message_no_extensions (
903- self , mock_httpx_client : AsyncMock , mock_agent_card : MagicMock
904- ):
905- """Test that send_message does not add extension headers when client_extensions is None."""
906- client = JsonRpcTransport (
907- httpx_client = mock_httpx_client ,
908- client_extensions = None ,
909- agent_card = mock_agent_card ,
910- )
911- params = MessageSendParams (
912- message = create_text_message_object (content = 'Hello' )
913- )
914- success_response = create_text_message_object (
915- role = Role .agent , content = 'Hi there!'
916- )
917- rpc_response = SendMessageSuccessResponse (
918- id = '123' , jsonrpc = '2.0' , result = success_response
919- )
920- # Mock the response from httpx_client.post
921- mock_response = AsyncMock (spec = httpx .Response )
922- mock_response .status_code = 200
923- mock_response .json .return_value = rpc_response .model_dump (mode = 'json' )
924- mock_httpx_client .post .return_value = mock_response
925-
926- await client .send_message (request = params )
927-
928- mock_httpx_client .post .assert_called_once ()
929- _ , mock_kwargs = mock_httpx_client .post .call_args
930- headers = mock_kwargs .get ('headers' , {})
931- assert HTTP_EXTENSION_HEADER not in headers
932-
933901 @pytest .mark .asyncio
934902 @patch ('a2a.client.transports.jsonrpc.aconnect_sse' )
935903 async def test_send_message_streaming_with_extensions (
0 commit comments