File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1818 TaskStatus ,
1919 TextPart ,
2020)
21- from a2a .utils import proto_utils
21+ from a2a .utils import get_text_parts , proto_utils
2222
2323
2424# Fixtures
@@ -112,6 +112,26 @@ async def test_send_message_task_response(
112112 assert response .id == sample_task .id
113113
114114
115+ @pytest .mark .asyncio
116+ async def test_send_message_message_response (
117+ grpc_transport : GrpcTransport ,
118+ mock_grpc_stub : AsyncMock ,
119+ sample_message_send_params : MessageSendParams ,
120+ sample_message : Message ,
121+ ):
122+ """Test send_message that returns a Message."""
123+ mock_grpc_stub .SendMessage .return_value = a2a_pb2 .SendMessageResponse (
124+ msg = proto_utils .ToProto .message (sample_message )
125+ )
126+
127+ response = await grpc_transport .send_message (sample_message_send_params )
128+
129+ mock_grpc_stub .SendMessage .assert_awaited_once ()
130+ assert isinstance (response , Message )
131+ assert response .message_id == sample_message .message_id
132+ assert get_text_parts (response .parts ) == get_text_parts (sample_message .parts )
133+
134+
115135@pytest .mark .asyncio
116136async def test_get_task (
117137 grpc_transport : GrpcTransport , mock_grpc_stub : AsyncMock , sample_task : Task
You can’t perform that action at this time.
0 commit comments