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

Function test_dict

python/pyfory/format/tests/test_encoder.py:133–140  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131
132
133def test_dict():
134 dict_ = {"f1": 1, "f2": "str"}
135 s = schema([field("f1", int64()), field("f2", utf8())])
136 encoder = pyfory.create_row_encoder(s)
137 row = encoder.to_row(dict_)
138 new_obj = encoder.from_row(row)
139 assert new_obj.f1 == dict_["f1"]
140 assert new_obj.f2 == dict_["f2"]
141
142
143def test_ints():

Callers

nothing calls this directly

Calls 6

schemaFunction · 0.85
utf8Function · 0.85
from_rowMethod · 0.80
fieldFunction · 0.50
int64Function · 0.50
to_rowMethod · 0.45

Tested by

no test coverage detected