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

Function test_pickle_buffer_serialization

python/pyfory/tests/test_pickle_buffer.py:34–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33
34def test_pickle_buffer_serialization():
35 fory = Fory(xlang=False, ref=False, strict=False, compatible=False)
36
37 data = b"Hello, PickleBuffer!"
38 pickle_buffer = pickle.PickleBuffer(data)
39
40 serialized = fory.serialize(pickle_buffer)
41 deserialized = fory.deserialize(serialized)
42
43 assert isinstance(deserialized, pickle.PickleBuffer)
44 assert bytes(deserialized.raw()) == data
45
46
47@pytest.mark.skipif(np is None, reason="Requires numpy")

Callers

nothing calls this directly

Calls 4

serializeMethod · 0.95
deserializeMethod · 0.95
ForyClass · 0.90
rawMethod · 0.45

Tested by

no test coverage detected