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

Function create_foo

python/pyfory/tests/record.py:74–87  ·  view source on GitHub ↗
(foo_cls=Foo, bar_cls=Bar)

Source from the content-addressed store, hash-verified

72
73
74def create_foo(foo_cls=Foo, bar_cls=Bar):
75 obj = foo_cls.__new__(foo_cls)
76 size = 10
77 data = {
78 "f1": 1,
79 "f2": "str",
80 "f3": ["str" + str(i) for i in range(size)],
81 "f4": {"k" + str(i): i for i in range(size)},
82 "f5": [-i for i in range(size)],
83 "f6": -100,
84 "f7": create_bar(bar_cls),
85 }
86 obj.__dict__.update(**data)
87 return obj
88
89
90def create_bar(cls):

Callers 3

test_encodeFunction · 0.90
test_encodeFunction · 0.90
test_decodeFunction · 0.90

Calls 2

create_barFunction · 0.70
updateMethod · 0.65

Tested by 3

test_encodeFunction · 0.72
test_encodeFunction · 0.72
test_decodeFunction · 0.72