(data_file_path)
| 158 | |
| 159 | @cross_language_test |
| 160 | def test_encoder_without_schema(data_file_path): |
| 161 | encoder = pyfory.encoder(FooPOJO) |
| 162 | debug_print(encoder) |
| 163 | foo = create_foo(foo_cls=FooPOJO, bar_cls=BarPOJO) |
| 164 | with open(data_file_path, "rb+") as f: |
| 165 | data_bytes = f.read() |
| 166 | obj = encoder.decode(data_bytes) |
| 167 | debug_print("deserialized foo", obj) |
| 168 | # Compare by dict since decoder returns a record class, not the original class |
| 169 | assert to_dict(obj) == to_dict(foo) |
| 170 | f.seek(0) |
| 171 | f.truncate() |
| 172 | f.write(encoder.encode(foo)) |
| 173 | |
| 174 | |
| 175 | @cross_language_test |
nothing calls this directly
no test coverage detected