Convenience for comparing with actual files written
(expected: list[str], store: str)
| 4505 | write_empty: bool | None, |
| 4506 | ) -> None: |
| 4507 | def assert_expected_files(expected: list[str], store: str) -> None: |
| 4508 | """Convenience for comparing with actual files written""" |
| 4509 | ls = [] |
| 4510 | test_root = os.path.join(store, "test") |
| 4511 | for root, _, files in os.walk(test_root): |
| 4512 | ls.extend( |
| 4513 | [ |
| 4514 | os.path.join(root, f).removeprefix(test_root).lstrip("/") |
| 4515 | for f in files |
| 4516 | ] |
| 4517 | ) |
| 4518 | |
| 4519 | assert set(expected) == { |
| 4520 | file.lstrip("c/") |
| 4521 | for file in ls |
| 4522 | if (file not in (".zattrs", ".zarray", "zarr.json")) |
| 4523 | } |
| 4524 | |
| 4525 | # The zarr format is set by the `default_zarr_format` |
| 4526 | # pytest fixture that acts on a superclass |