(tmp_path: Path)
| 7509 | |
| 7510 | @requires_h5netcdf |
| 7511 | def test_h5netcdf_entrypoint(tmp_path: Path) -> None: |
| 7512 | entrypoint = H5netcdfBackendEntrypoint() |
| 7513 | ds = create_test_data() |
| 7514 | |
| 7515 | path = tmp_path / "foo" |
| 7516 | ds.to_netcdf(path, engine="h5netcdf") |
| 7517 | _check_guess_can_open_and_open(entrypoint, path, engine="h5netcdf", expected=ds) |
| 7518 | _check_guess_can_open_and_open( |
| 7519 | entrypoint, str(path), engine="h5netcdf", expected=ds |
| 7520 | ) |
| 7521 | with open(path, "rb") as f: |
| 7522 | _check_guess_can_open_and_open(entrypoint, f, engine="h5netcdf", expected=ds) |
| 7523 | |
| 7524 | contents = ds.to_netcdf(engine="h5netcdf") |
| 7525 | _check_guess_can_open_and_open(entrypoint, contents, engine="h5netcdf", expected=ds) |
| 7526 | |
| 7527 | assert entrypoint.guess_can_open("something-local.nc") |
| 7528 | assert entrypoint.guess_can_open("something-local.nc4") |
| 7529 | assert entrypoint.guess_can_open("something-local.cdf") |
| 7530 | assert not entrypoint.guess_can_open("not-found-and-no-extension") |
| 7531 | |
| 7532 | |
| 7533 | @requires_zarr |
nothing calls this directly
no test coverage detected
searching dependent graphs…