()
| 51 | |
| 52 | |
| 53 | def 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) |
nothing calls this directly
no test coverage detected