class_docstr: Main test class for the LI L2 reader.
class_docstr_tok: ["Main","test","class","for","the","LI","L2","reader","."]
docstr: Test get_first_valid_variable from li reader.
docstr_tok: ["Test","get_first_valid_variable","from","li","reader","."]
code: def test_get_first_valid_variable(self, filetype_infos):
      """Test get_first_valid_variable from li reader."""
      filename_info = {
          "start_time": "20101112131415",
          "end_time": "20101112131416",
      }
  
      handler = LIL2NCFileHandler(
          "filename",
          filename_info,
          extract_filetype_info(filetype_infos, "li_l2_lef_nc"),
      )
  
      # Check variable paths:
      var1 = handler.get_first_valid_variable(
          ["dummy/path", "data/north/event_id"]
      )
      var2 = handler.get_first_valid_variable(
          ["dummy/path", "data/east/event_id"]
      )
      var3 = handler.get_first_valid_variable(
          ["dummy/path", "data/south/group_id"]
      )
      var4 = handler.get_first_valid_variable(
          ["dummy/path", "data/west/group_id"]
      )
  
      assert isinstance(var1, xr.DataArray)
      assert isinstance(var2, xr.DataArray)
      assert isinstance(var3, xr.DataArray)
      assert isinstance(var4, xr.DataArray)
  
      assert id(var1) != id(var2)
      assert id(var2) != id(var3)
      assert id(var3) != id(var4)
  
      mix1 = handler.get_first_valid_variable(
          [
              "dummy/path",
              "data/north/event_id",
              "data/east/event_id",
              "data/south/group_id",
          ]
      )
  
      mix2 = handler.get_first_valid_variable(
          [
              "dummy/path",
              "data/west/group_id",
              "data/north/event_id",
              "data/east/event_id",
              "data/south/group_id",
          ]
      )
  
      # first mix should give us var1 and the second one var4:
      assert id(mix1) == id(var1)
      assert id(mix2) == id(var4)
  
      # get the measured variables now:
      # Note that we must specify fill_value==None below otherwise
      # a new array is generated filling the invalid values:
      meas1 = handler.get_measured_variable(
          "east/event_id", fill_value=None
      )
      meas2 = handler.get_measured_variable(
          "south/group_id", fill_value=None
      )
  
      assert id(meas1) == id(var2)
      assert id(meas2) == id(var3)
  
      # We should have a fill value on those variables:
      assert var1.attrs.get("_FillValue") == 65535
      assert var2.attrs.get("_FillValue") == 65535
  
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 14 for calling the TestLIL2 obj's underlying member method code with example usage: obj.test_get_first_valid_variable(filetype_infos) without return types