diff --git a/satpy/tests/reader_tests/modis_tests/_modis_fixtures.py b/satpy/tests/reader_tests/modis_tests/_modis_fixtures.py index 04704630e4..b47b63c18c 100644 --- a/satpy/tests/reader_tests/modis_tests/_modis_fixtures.py +++ b/satpy/tests/reader_tests/modis_tests/_modis_fixtures.py @@ -227,7 +227,14 @@ def _get_l3_land_cover_info() -> dict: "attrs": { "dim_labels": ["YDim:MCD12Q1", "XDim:MCD12Q1"], }, - } + }, + "LC_Type2": {"data": lc_data, + "type": SDC.UINT8, + "fill_value": 255, + "attrs": { + "dim_labels": ["YDim:MCD12Q1", "XDim:MCD12Q1"], + }, + }, } return variables_info diff --git a/satpy/tests/reader_tests/modis_tests/test_modis_l3_mcd12q1.py b/satpy/tests/reader_tests/modis_tests/test_modis_l3_mcd12q1.py index 21bb14f8b6..c34ec438e5 100644 --- a/satpy/tests/reader_tests/modis_tests/test_modis_l3_mcd12q1.py +++ b/satpy/tests/reader_tests/modis_tests/test_modis_l3_mcd12q1.py @@ -28,18 +28,6 @@ # - modis_l3_nasa_mcd12q1_file -def _check_shared_metadata(data_arr, expect_area=False): - assert data_arr.attrs["sensor"] == "modis" - assert data_arr.attrs["platform_name"] == "EOS-Terra" - assert "rows_per_scan" in data_arr.attrs - assert isinstance(data_arr.attrs["rows_per_scan"], int) - assert data_arr.attrs["reader"] == "mcd12q1" - if expect_area: - assert data_arr.attrs.get("area") is not None - else: - assert "area" not in data_arr.attrs - - class TestModisL3MCD12Q1: """Test MODIS L3 MCD12Q1 reader.""" @@ -47,6 +35,14 @@ def test_available_reader(self): """Test that MODIS L3 reader is available.""" assert "mcd12q1" in available_readers() + def test_metadata(self, modis_l3_nasa_mcd12q1_file): + """Test some basic metadata that should exist in the file.""" + scene = Scene(reader="mcd12q1", filenames=modis_l3_nasa_mcd12q1_file) + ds_name = "LC_Type2" + scene.load([ds_name]) + assert scene[ds_name].attrs['area'].description == 'Tiled sinusoidal L3 MODIS area' + assert scene[ds_name].attrs['sensor'] == 'modis' + def test_scene_available_datasets(self, modis_l3_nasa_mcd12q1_file): """Test that datasets are available.""" scene = Scene(reader="mcd12q1", filenames=modis_l3_nasa_mcd12q1_file)