Skip to content

Commit 28101d4

Browse files
committed
Fix tests
1 parent e2b8d73 commit 28101d4

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/server/routes/test_rest_dispatcher.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,8 @@ async def test_on_message_send_stream_success(
264264
chunks.append(chunk)
265265

266266
assert len(chunks) == 2
267-
# sse-starlette yields strings or bytes formatted as Server-Sent Events
268-
assert 'chunk1' in str(chunks[0])
269-
assert 'chunk2' in str(chunks[1])
267+
assert 'chunk1' in chunks[0].data
268+
assert 'chunk2' in chunks[1].data
270269

271270
async def test_on_subscribe_to_task_success(self, rest_dispatcher_instance):
272271
req = make_mock_request(method='GET', path_params={'id': 'test_task'})
@@ -279,8 +278,8 @@ async def test_on_subscribe_to_task_success(self, rest_dispatcher_instance):
279278
chunks.append(chunk)
280279

281280
assert len(chunks) == 2
282-
assert 'chunk1' in str(chunks[0])
283-
assert 'chunk2' in str(chunks[1])
281+
assert 'chunk1' in chunks[0].data
282+
assert 'chunk2' in chunks[1].data
284283

285284
async def test_on_message_send_stream_handler_error(self, mock_handler):
286285
from a2a.utils.errors import UnsupportedOperationError

0 commit comments

Comments
 (0)