@@ -130,9 +130,10 @@ async def test_streaming_with_futures(self, mock_http_echo_server, tmp_path):
130130 assert result .response_output == f"Non-streaming request { idx } "
131131 else :
132132 assert result .id == f"stream-{ idx } "
133+ assert list (result .response_output .keys ()) == ["output" ]
133134 assert (
134- "Streaming" in result .response_output
135- or result . response_output == f"Streaming request { idx } "
135+ "" . join ( result .response_output [ "output" ])
136+ == f"Streaming request { idx } "
136137 )
137138
138139 finally :
@@ -194,7 +195,10 @@ async def test_mixed_streaming_non_streaming(self, futures_http_client):
194195 ]
195196 else :
196197 # Streaming response
197- assert "" .join (result .response_output ) == "Streaming response test"
198+ assert (
199+ "" .join (result .response_output ["output" ])
200+ == "Streaming response test"
201+ )
198202
199203 @pytest .mark .asyncio
200204 async def test_concurrent_streaming_requests (self , futures_http_client ):
@@ -224,7 +228,7 @@ async def test_concurrent_streaming_requests(self, futures_http_client):
224228 for idx , result in results :
225229 assert result .id == f"concurrent-stream-{ idx } "
226230 assert (
227- "" .join (result .response_output )
231+ "" .join (result .response_output [ "output" ] )
228232 == f"Concurrent streaming request number { idx } "
229233 )
230234 assert result .error is None
@@ -265,7 +269,7 @@ async def track_resolution(future):
265269 assert resolution_count == 1
266270 assert resolved_result is not None
267271 assert resolved_result .id == "test-single-resolution"
268- assert resolved_result .response_output == (
272+ assert resolved_result .response_output [ "output" ] == (
269273 "Test" ,
270274 " single future resolution with multiple words" ,
271275 )
@@ -303,8 +307,10 @@ async def test_streaming_future_first_chunk_access(self, futures_http_client):
303307
304308 # Get complete response
305309 result = await future
306- assert result .response_output [0 ] == "Test"
307- assert result .response_output [1 ] == " first chunk access functionality"
310+ assert result .response_output ["output" ][0 ] == "Test"
311+ assert (
312+ result .response_output ["output" ][1 ] == " first chunk access functionality"
313+ )
308314
309315 # Test 2: Check if first chunk is ready after awaiting
310316 query2 = Query (
@@ -347,8 +353,7 @@ async def test_streaming_single_chunk_complete(self, futures_http_client):
347353
348354 # Complete response should be the same
349355 result = await future
350- assert result .response_output [0 ] == "Hi"
351- assert result .response_output [1 ] == ""
356+ assert result .response_output ["output" ] == ("Hi" ,)
352357
353358 @pytest .mark .asyncio
354359 async def test_streaming_race_first_chunks (self , futures_http_client ):
@@ -391,8 +396,8 @@ async def test_streaming_race_first_chunks(self, futures_http_client):
391396 # Get first complete
392397 winner = done .pop ().result ()
393398 assert winner .id .startswith ("race-" )
394- assert winner .response_output [0 ] == "Query"
395- assert winner .response_output [1 ].startswith (" number" )
399+ assert winner .response_output ["output" ][ 0 ] == "Query"
400+ assert winner .response_output ["output" ][ 1 ].startswith (" number" )
396401
397402 # Clean up remaining
398403 for f in pending :
@@ -498,4 +503,4 @@ async def test_streaming_concurrent_mixed_lengths(self, futures_http_client):
498503 assert first == prompt .split ()[0 ] if prompt else ""
499504
500505 result = await future
501- assert "" .join (result .response_output ) == prompt
506+ assert "" .join (result .response_output [ "output" ] ) == prompt
0 commit comments