| 11 | ) |
| 12 | @pytest.mark.parametrize("format", ["numpy", "parquet"]) |
| 13 | def test_array_readwriter(format, shape): |
| 14 | original_array = np.random.rand(*shape) |
| 15 | fmt_meta = {"name": format} |
| 16 | |
| 17 | with tempfile.TemporaryDirectory() as test_dir: |
| 18 | path = os.path.join(test_dir, f"nodes.{format}") |
| 19 | array_readwriter.get_array_parser(**fmt_meta).write( |
| 20 | path, original_array |
| 21 | ) |
| 22 | array = array_readwriter.get_array_parser(**fmt_meta).read(path) |
| 23 | |
| 24 | assert original_array.shape == array.shape |
| 25 | assert np.array_equal(original_array, array) |