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

Function test_staticmethod_serialization

python/pyfory/tests/test_method.py:226–240  ·  view source on GitHub ↗

Standalone test for staticmethod serialization.

()

Source from the content-addressed store, hash-verified

224
225
226def test_staticmethod_serialization():
227 """Standalone test for staticmethod serialization."""
228 fory = pyfory.Fory(xlang=False, strict=False, ref=True, compatible=False)
229
230 class A:
231 @staticmethod
232 def g():
233 return "static_result"
234
235 method = A.g
236 serialized = fory.serialize(method)
237 deserialized = fory.deserialize(serialized)
238
239 assert method() == deserialized()
240 assert method() == "static_result"
241
242
243# Global class method tests

Callers

nothing calls this directly

Calls 3

serializeMethod · 0.95
deserializeMethod · 0.95
ForyMethod · 0.45

Tested by

no test coverage detected