MCPcopy Index your code
hub / github.com/apache/fory / test_inheritance

Function test_inheritance

python/pyfory/tests/test_struct.py:620–627  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

618
619
620def test_inheritance():
621 type_hints = typing.get_type_hints(ChildClass1)
622 print(type_hints)
623 assert type_hints.keys() == {"f1", "f2", "f3"}
624 fory = Fory(xlang=False, ref=True, strict=False, compatible=False)
625 obj = ChildClass1(f1="a", f2=-10, f3={"a": -10.0, "b": 1 / 3})
626 assert ser_de(fory, obj) == obj
627 assert type(fory.type_resolver.get_serializer(ChildClass1)) is pyfory.DataClassSerializer
628
629
630@dataclass

Callers

nothing calls this directly

Calls 5

ForyClass · 0.90
ChildClass1Class · 0.85
get_serializerMethod · 0.80
ser_deFunction · 0.70
keysMethod · 0.45

Tested by

no test coverage detected