Skip to content

Commit bc59cb6

Browse files
committed
fix test
1 parent 1cc0ffc commit bc59cb6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python-sdk/tests/test_encoder.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from ag_ui.encoder.encoder import EventEncoder, AGUI_MEDIA_TYPE
66
from ag_ui.core.events import BaseEvent, EventType, TextMessageContentEvent, ToolCallStartEvent
77

8-
98
class TestEventEncoder(unittest.TestCase):
109
"""Test suite for EventEncoder class"""
1110

@@ -29,7 +28,10 @@ def test_encode_method(self):
2928
encoded = encoder.encode(event)
3029

3130
# The encode method calls encode_sse, so the result should be in SSE format
32-
expected = f"data: {event.model_dump_json(by_alias=True, exclude_none=True)}\n\n"
31+
event_dict = event.model_dump(by_alias=True, exclude_none=True)
32+
json_ready = self.make_json_safe(event_dict)
33+
json_string = json.dumps(json_ready)
34+
expected = f"data: {json_string}\n\n"
3335
self.assertEqual(encoded, expected)
3436

3537
# Verify that camelCase is used in the encoded output

0 commit comments

Comments
 (0)