Skip to content

Commit 456eaf7

Browse files
committed
Update
1 parent 1a4017a commit 456eaf7

1 file changed

Lines changed: 10 additions & 32 deletions

File tree

tests/integration/test_end_to_end.py

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -686,14 +686,21 @@ async def test_end_to_end_subscribe_validation_error(
686686

687687

688688
@pytest.mark.asyncio
689-
async def test_end_to_end_direct_message_blocking(transport_setups):
689+
@pytest.mark.parametrize(
690+
'streaming',
691+
[
692+
pytest.param(False, id='blocking'),
693+
pytest.param(True, id='streaming'),
694+
],
695+
)
696+
async def test_end_to_end_direct_message(transport_setups, streaming):
690697
"""Test that an executor can return a direct Message without creating a Task."""
691698
client = transport_setups.client
692-
client._config.streaming = False
699+
client._config.streaming = streaming
693700

694701
message_to_send = Message(
695702
role=Role.ROLE_USER,
696-
message_id='msg-direct-blocking',
703+
message_id='msg-direct',
697704
parts=[Part(text='Message: Hello agent')],
698705
)
699706

@@ -751,32 +758,3 @@ async def test_end_to_end_direct_message_return_immediately(transport_setups):
751758
Role.ROLE_AGENT,
752759
'Direct reply to: Message: Quick question',
753760
)
754-
755-
756-
@pytest.mark.asyncio
757-
async def test_end_to_end_direct_message_streaming(transport_setups):
758-
"""Test that streaming returns a direct Message and terminates the stream."""
759-
client = transport_setups.client
760-
761-
message_to_send = Message(
762-
role=Role.ROLE_USER,
763-
message_id='msg-direct-streaming',
764-
parts=[Part(text='Message: Hello streaming')],
765-
)
766-
767-
events = [
768-
event
769-
async for event in client.send_message(
770-
request=SendMessageRequest(message=message_to_send)
771-
)
772-
]
773-
774-
assert len(events) == 1
775-
response = events[0]
776-
assert response.HasField('message')
777-
assert not response.HasField('task')
778-
assert_message_matches(
779-
response.message,
780-
Role.ROLE_AGENT,
781-
'Direct reply to: Message: Hello streaming',
782-
)

0 commit comments

Comments
 (0)