()
| 86 | |
| 87 | |
| 88 | def test_encode(): |
| 89 | print(foo_schema()) |
| 90 | encoder = pyfory.create_row_encoder(foo_schema()) |
| 91 | foo = create_foo() |
| 92 | print("foo", foo) |
| 93 | row = encoder.to_row(foo) |
| 94 | print("row bytes length", len(row.to_bytes())) |
| 95 | print("row bytes", row.to_bytes()) |
| 96 | print("row", row) # test __str__ |
| 97 | new_foo = encoder.from_row(row) |
| 98 | print("new_foo", new_foo) |
| 99 | assert foo.f1 == new_foo.f1 |
| 100 | assert foo.f2 == new_foo.f2 |
| 101 | assert foo.f3 == new_foo.f3 |
| 102 | assert foo.f4 == new_foo.f4 |
| 103 | assert foo.f5 == new_foo.f5 |
| 104 | assert foo.f6 == new_foo.f6 |
| 105 | |
| 106 | |
| 107 | def test_row_and_array_reject_one_past_end_index(): |
nothing calls this directly
no test coverage detected