MCPcopy Index your code
hub / github.com/pathwaycom/pathway / test_json_serialize_parse

Function test_json_serialize_parse

python/pathway/tests/test_json.py:1314–1325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1312
1313
1314def test_json_serialize_parse():
1315 base_unicode_value = "żółć"
1316 base = {"data": base_unicode_value}
1317
1318 initial_json = pw.Json(base)
1319 serialized = pw.Json.dumps(initial_json)
1320 roundtrip_json = pw.Json.parse(serialized)
1321 assert roundtrip_json["data"] == pw.Json(base_unicode_value)
1322
1323 serialized_ensure_ascii = json.dumps(base, ensure_ascii=True)
1324 roundtrip_json_old_format = pw.Json.parse(serialized_ensure_ascii)
1325 assert roundtrip_json_old_format["data"] == pw.Json(base_unicode_value)
1326
1327
1328def test_json_doesnt_enforce_ascii(capsys):

Callers

nothing calls this directly

Calls 2

dumpsMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected