Skip to content

Commit 12dfcc6

Browse files
committed
Update test_agent.py
1 parent 8654aed commit 12dfcc6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/tutorials/00_sync/010_multiturn/tests/test_agent.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,20 @@ def test_stream_message(self, test_agent):
7777
# Get streaming response
7878
response_gen = test_agent.send_message_streaming(msg)
7979

80-
# Collect streaming deltas
80+
# Collect the streaming response
8181
aggregated_content, chunks = collect_streaming_deltas(response_gen)
8282

83+
assert len(chunks) == 1
84+
8385
# Validate we got content
84-
assert len(chunks) > 0, "Should receive chunks"
8586
assert len(aggregated_content) > 0, "Should receive content"
8687

8788
# Validate that "tennis" appears in the response because that is what our model does
8889
assert "tennis" in aggregated_content.lower()
8990

9091
# Verify conversation history (only user messages tracked with streaming)
91-
history = test_agent.get_conversation_history()
92-
assert len(history) == (i + 1), f"Expected {(i + 1)} user messages, got {len(history)}"
92+
message_history = test_agent.get_conversation_history()
93+
assert len(message_history) == (i + 1), f"Expected {(i + 1)} user messages, got {len(message_history)}"
9394

9495

9596
if __name__ == "__main__":

0 commit comments

Comments
 (0)