MCPcopy Create free account
hub / github.com/bopen/xarray-sentinel / test_open_dataset_root

Function test_open_dataset_root

tests/test_30_xarray_backends.py:53–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

51
52
53def test_open_dataset_root() -> None:
54 product_path = (
55 DATA_FOLDER
56 / "S1B_IW_SLC__1SDV_20210401T052622_20210401T052650_026269_032297_EFA4.SAFE"
57 )
58 res = xr.open_dataset(product_path, engine="sentinel-1")
59
60 assert isinstance(res, xr.Dataset)
61 for attr_name in COMMON_ATTRIBUTES:
62 assert attr_name in res.attrs
63 assert res.attrs[attr_name] == COMMON_ATTRIBUTES[attr_name]
64
65 res = xr.open_dataset(product_path)
66
67 assert isinstance(res, xr.Dataset)
68
69 product_path = product_path / "manifest.safe"
70
71 res = xr.open_dataset(product_path, engine="sentinel-1")
72
73 assert isinstance(res, xr.Dataset)
74
75 res = xr.open_dataset(product_path)
76
77 assert isinstance(res, xr.Dataset)
78
79 with pytest.raises((ValueError, FileNotFoundError)):
80 xr.open_dataset("")
81
82
83@pytest.mark.parametrize("product_path,swath_pol", SENTINEL1_SLC_PRODUCTS)

Callers

nothing calls this directly

Calls 1

open_datasetMethod · 0.80

Tested by

no test coverage detected