class_docstr: Main test class for the LI L2 reader.
class_docstr_tok: ["Main","test","class","for","the","LI","L2","reader","."]
docstr: Test that the method is called only once.
docstr_tok: ["Test","that","the","method","is","called","only","once","."]
code: def test_generate_coords_called_once(Self, filetype_infos):
      """Test that the method is called only once."""
      handler = LIL2NCFileHandler(
          "filename",
          {},
          extract_filetype_info(filetype_infos, "li_l2_af_nc"),
      )
      # check internal variable is empty
      assert len(handler.internal_variables) == 0
      coordinate_datasets = ["longitude", "latitude"]
      handler.generate_coords_from_scan_angles = mock.MagicMock(
          side_effect=handler.generate_coords_from_scan_angles
      )
  
      for ds_name in coordinate_datasets:
          dsid = make_dataid(name=ds_name)
          dset = handler.get_dataset(dsid)
          # Check dataset type
          assert isinstance(dset, xr.DataArray)
          assert len(handler.internal_variables) == 2
          assert handler.generate_coords_from_scan_angles.called
  
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 30 for calling the TestLIL2 obj's underlying member method code with example usage: obj.test_generate_coords_called_once(Self, filetype_infos) without return types