class_docstr: Test various nc_slstr file handlers.
class_docstr_tok: ["Test","various","nc_slstr","file","handlers","."]
docstr: Test initialization of file handlers.
docstr_tok: ["Test","initialization","of","file","handlers","."]
code: def test_instantiate(self, bvs_, xr_):
      """Test initialization of file handlers."""
      bvs_.return_value = self.FakeSpl
      xr_.open_dataset.return_value = self.fake_dataset
  
      good_start = datetime.strptime(
          self.start_time, "%Y-%m-%dT%H:%M:%S.%fZ"
      )
      good_end = datetime.strptime(
          self.end_time, "%Y-%m-%dT%H:%M:%S.%fZ"
      )
  
      ds_id = make_dataid(
          name="foo", calibration="radiance", stripe="a", view="nadir"
      )
      ds_id_500 = make_dataid(
          name="foo",
          calibration="radiance",
          stripe="a",
          view="nadir",
          resolution=500,
      )
      filename_info = {
          "mission_id": "S3A",
          "dataset_name": "foo",
          "start_time": 0,
          "end_time": 0,
          "stripe": "a",
          "view": "n",
      }
      test = NCSLSTR1B("somedir/S1_radiance_an.nc", filename_info, "c")
      assert test.view == "nadir"
      assert test.stripe == "a"
      with pytest.warns(
          UserWarning,
          match=r"No radiance adjustment supplied for channel",
      ):
          test.get_dataset(
              ds_id, dict(filename_info, **{"file_key": "foo"})
          )
      assert test.start_time == good_start
      assert test.end_time == good_end
      xr_.open_dataset.assert_called()
      xr_.open_dataset.reset_mock()
  
      filename_info = {
          "mission_id": "S3A",
          "dataset_name": "foo",
          "start_time": 0,
          "end_time": 0,
          "stripe": "c",
          "view": "o",
      }
      test = NCSLSTR1B("somedir/S1_radiance_co.nc", filename_info, "c")
      assert test.view == "oblique"
      assert test.stripe == "c"
      test.get_dataset(
          ds_id, dict(filename_info, **{"file_key": "foo"})
      )
      assert test.start_time == good_start
      assert test.end_time == good_end
      xr_.open_dataset.assert_called()
      xr_.open_dataset.reset_mock()
  
      filename_info = {
          "mission_id": "S3A",
          "dataset_name": "foo",
          "start_time": 0,
          "end_time": 0,
          "stripe": "a",
          "view": "n",
      }
      test = NCSLSTRGeo("somedir/geometry_an.nc", filename_info, "c")
      test.get_dataset(
          ds_id,
          dict(
              filename_info,
              **{"file_key": "latitude_{stripe:1s}{view:1s}"},
          ),
      )
      assert test.start_time == good_start
      assert test.end_time == good_end
      xr_.open_dataset.assert_called()
      xr_.open_dataset.reset_mock()
  
      test = NCSLSTRFlag(
          "somedir/S1_radiance_an.nc", filename_info, "c"
      )
      test.get_dataset(
          ds_id,
          dict(
              filename_info,
              **{"file_key": "flags_{stripe:1s}{view:1s}"},
          ),
      )
      assert test.view == "nadir"
      assert test.stripe == "a"
      assert test.start_time == good_start
      assert test.end_time == good_end
      xr_.open_dataset.assert_called()
      xr_.open_dataset.reset_mock()
  
      test = NCSLSTRAngles(
          "somedir/S1_radiance_an.nc", filename_info, "c"
      )
      test.get_dataset(
          ds_id,
          dict(filename_info, **{"file_key": "geometry_t{view:1s}"}),
      )
      assert test.start_time == good_start
      assert test.end_time == good_end
      xr_.open_dataset.assert_called()
      xr_.open_dataset.reset_mock()
      test.get_dataset(
          ds_id_500,
          dict(filename_info, **{"file_key": "geometry_t{view:1s}"}),
      )
  
file_path: satpy/satpy/tests/reader_tests/test_slstr_l1b.py
imports: import unittest
  import unittest.mock
  from datetime import datetime
  import numpy
  import pytest
  import xarray
  from satpy.dataset.dataid import DataID, ModifierTuple, WavelengthRange
  from satpy.readers.slstr_l1b import NCSLSTR1B, NCSLSTRAngles, NCSLSTRFlag, NCSLSTRGeo
label_desc: Use image node_id 1 for calling the TestSLSTRReader obj's underlying member method code with example usage: obj.test_instantiate(bvs_, xr_) without return types