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

Function test_thread_safe_fory_registration

python/pyfory/tests/test_thread_safe.py:88–104  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87
88def test_thread_safe_fory_registration():
89 fory = ThreadSafeFory(
90 xlang=False,
91 compatible=False,
92 )
93 fory.register(Person, type_id=100)
94 fory.register(Address, name="test.Address")
95
96 person = Person(name="Bob", age=25)
97 data = fory.serialize(person)
98 result = fory.deserialize(data)
99 assert result.name == person.name
100
101 address = Address(city="NYC", country="USA")
102 data = fory.serialize(address)
103 result = fory.deserialize(data)
104 assert result.city == address.city
105
106
107def test_thread_safe_fory_xlang_mode():

Callers

nothing calls this directly

Calls 6

registerMethod · 0.95
serializeMethod · 0.95
deserializeMethod · 0.95
ThreadSafeForyClass · 0.90
PersonClass · 0.70
AddressClass · 0.70

Tested by

no test coverage detected