class_docstr: Main test class for the LI L2 reader.
class_docstr_tok: ["Main","test","class","for","the","LI","L2","reader","."]
docstr: Should report time variables as numpy datetime64 type and time durations as timedelta64.
docstr_tok: ["Should","report","time","variables","as","numpy","datetime64","type","and","time","durations","as","timedelta64","."]
code: def test_report_datetimes(self, filetype_infos):
      """Should report time variables as numpy datetime64 type and time durations as timedelta64."""
      handler = LIL2NCFileHandler(
          "filename",
          {},
          extract_filetype_info(filetype_infos, "li_l2_le_nc"),
      )
  
      # Check epoch_time:
      dsid = make_dataid(name="epoch_time_north_sector")
      dset = handler.get_dataset(dsid)
      assert dset.values.dtype == np.dtype("datetime64[ns]")
  
      # The default epoch_time should be 1.234 seconds after epoch:
      ref_time = np.datetime64(datetime(2000, 1, 1, 0, 0, 1, 234000))
      assert np.all(dset.values == ref_time)
  
      # Check time_offset:
      dsid = make_dataid(name="time_offset_east_sector")
      dset = handler.get_dataset(dsid)
      assert dset.values.dtype == np.dtype("timedelta64[ns]")
  
      # The default time_offset should be: np.linspace(0.0, 1000.0, nobs)
      # but then we first multiply by 1e6 to generate us times:
      # Note that below no automatic transform to np.float64 is happening:
      nobs = dset.shape[0]
      ref_data = np.linspace(0.0, 1000.0, nobs).astype(np.float32)
      ref_data = (ref_data * 1e9).astype("timedelta64[ns]")
  
      # And not absolutely sure why, but we always get the timedelta in ns from the dataset:
      # ref_data = (ref_data).astype('timedelta64[ns]')
  
      assert np.all(dset.values == ref_data)
  
imports: import os
  from datetime import datetime
  from unittest import mock
  import numpy
  import pytest
  import xarray
  from pyproj import Proj
  from satpy._config import config_search_paths
  from satpy.readers.li_base_nc import LINCFileHandler
  from satpy.readers.li_l2_nc import LI_GRID_SHAPE, LIL2NCFileHandler
  from satpy.readers.yaml_reader import load_yaml_configs
  from satpy.tests.reader_tests._li_test_utils import FakeLIFileHandlerBase, extract_filetype_info, get_product_schema, products_dict
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 19 for calling the TestLIL2 obj's underlying member method code with example usage: obj.test_report_datetimes(filetype_infos) without return types