MCPcopy Create free account
hub / github.com/apache/fory / test_stream_roundtrip_nested_collections

Function test_stream_roundtrip_nested_collections

python/pyfory/tests/test_stream.py:142–153  ·  view source on GitHub ↗
(xlang)

Source from the content-addressed store, hash-verified

140
141@pytest.mark.parametrize("xlang", [False, True])
142def test_stream_roundtrip_nested_collections(xlang):
143 fory = pyfory.Fory(xlang=xlang, ref=True, compatible=xlang)
144 value = {
145 "name": "stream-object",
146 "items": [1, 2, {"k1": "v1", "k2": [3, 4, 5]}],
147 "scores": {"a": 10, "b": 20},
148 "flags": [True, False, True],
149 }
150
151 data = fory.serialize(value)
152 restored = fory.deserialize(Buffer.from_stream(OneByteStream(data)))
153 assert restored == value
154
155
156def test_stream_roundtrip_reference_graph_python_mode():

Callers

nothing calls this directly

Calls 4

serializeMethod · 0.95
deserializeMethod · 0.95
OneByteStreamClass · 0.85
ForyMethod · 0.45

Tested by

no test coverage detected