class_docstr: Test MODIS L1b reader.
class_docstr_tok: ["Test","MODIS","L1b","reader","."]
docstr: Test that datasets are available.
docstr_tok: ["Test","that","datasets","are","available","."]
code: def test_scene_available_datasets(
      self,
      input_files,
      expected_names,
      expected_data_res,
      expected_geo_res,
  ):
      """Test that datasets are available."""
      scene = Scene(reader="modis_l1b", filenames=input_files)
      available_datasets = scene.available_dataset_names()
      assert len(available_datasets) > 0
      assert "longitude" in available_datasets
      assert "latitude" in available_datasets
      for chan_name in expected_names:
          assert chan_name in available_datasets
  
      available_data_ids = scene.available_dataset_ids()
      available_datas = {x: [] for x in expected_data_res}
      available_geos = {x: [] for x in expected_geo_res}
      # Make sure that every resolution from the reader is what we expect
      for data_id in available_data_ids:
          res = data_id["resolution"]
          if data_id["name"] in ["longitude", "latitude"]:
              assert res in expected_geo_res
              available_geos[res].append(data_id)
          else:
              assert res in expected_data_res
              available_datas[res].append(data_id)
  
      # Make sure that every resolution we expect has at least one dataset
      for exp_res, avail_id in available_datas.items():
          assert (
              avail_id
          ), f"Missing datasets for data resolution {exp_res}"
      for exp_res, avail_id in available_geos.items():
          assert (
              avail_id
          ), f"Missing geo datasets for geo resolution {exp_res}"
  
file_path: satpy/satpy/tests/reader_tests/modis_tests/test_modis_l1b.py
imports: from __future__ import annotations
  import dask
  import numpy
  import pytest
  from pytest_lazyfixture import lazy_fixture
  from satpy import Scene, available_readers
  from satpy.tests.utils import CustomScheduler, make_dataid
  from ._modis_fixtures import AVAILABLE_1KM_PRODUCT_NAMES, AVAILABLE_HKM_PRODUCT_NAMES, AVAILABLE_QKM_PRODUCT_NAMES, _shape_for_resolution
label_desc: Use image node_id 2 for calling the TestModisL1b obj's underlying member method code with example usage: obj.test_scene_available_datasets(input_files, expected_names, expected_data_res, expected_geo_res) without return types