(tmp_path: Path)
| 7532 | |
| 7533 | @requires_zarr |
| 7534 | def test_zarr_entrypoint(tmp_path: Path) -> None: |
| 7535 | from xarray.backends.zarr import ZarrBackendEntrypoint |
| 7536 | |
| 7537 | entrypoint = ZarrBackendEntrypoint() |
| 7538 | ds = create_test_data() |
| 7539 | |
| 7540 | path = tmp_path / "foo.zarr" |
| 7541 | ds.to_zarr(path) |
| 7542 | _check_guess_can_open_and_open(entrypoint, path, engine="zarr", expected=ds) |
| 7543 | _check_guess_can_open_and_open(entrypoint, str(path), engine="zarr", expected=ds) |
| 7544 | |
| 7545 | # add a trailing slash to the path and check again |
| 7546 | _check_guess_can_open_and_open( |
| 7547 | entrypoint, str(path) + "/", engine="zarr", expected=ds |
| 7548 | ) |
| 7549 | |
| 7550 | # Test the new functionality: .zarr with trailing slash |
| 7551 | assert entrypoint.guess_can_open("something-local.zarr") |
| 7552 | assert entrypoint.guess_can_open("something-local.zarr/") # With trailing slash |
| 7553 | assert not entrypoint.guess_can_open("something-local.nc") |
| 7554 | assert not entrypoint.guess_can_open("not-found-and-no-extension") |
| 7555 | assert not entrypoint.guess_can_open("something.zarr.txt") |
| 7556 | |
| 7557 | |
| 7558 | @requires_h5netcdf |
nothing calls this directly
no test coverage detected
searching dependent graphs…