File tree Expand file tree Collapse file tree
agent_sdks/python/tests/parser Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 [{"beginRendering" : {"surfaceId" : "s1" , "root" : "r1" }}],
3232 ),
3333 ("{\u201c key\u201d : \u201c value\u201d }" , [{"key" : "value" }]),
34- (
35- "{\u201C outer\u201D : {\u201C inner\u201D : true}}" ,
36- [{"outer" : {"inner" : True }}],
37- ),
34+ ('{"text": "it\u2019 s fine"}' , [{"text" : "it's fine" }]),
3835 ("[]" , []),
39- ("[1, 2,]" , [1 , 2 ]),
4036 ],
4137)
4238def test_parse_and_fix_normalization (payload , expected ):
@@ -68,13 +64,6 @@ def test_parse_and_fix_multiple_messages():
6864 assert "surfaceUpdate" in result [1 ]
6965
7066
71- def test_parse_and_fix_single_object_wrapped_in_list ():
72- payload = '{"beginRendering": {"surfaceId": "s1", "root": "r1"}}'
73- result = parse_and_fix (payload )
74- assert isinstance (result , list )
75- assert len (result ) == 1
76-
77-
7867def test_parse_and_fix_logs_warnings_on_trailing_comma_autofix (caplog ):
7968 payload = '[{"key": "value",}]'
8069 with caplog .at_level (logging .WARNING , logger = "a2ui.parser.payload_fixer" ):
You can’t perform that action at this time.
0 commit comments