class_docstr: Test the GACLAC file handler.
docstr: Test slicing.
code: def test__slice(self, strip_invalid_lat, get_qual_flags):
      """Test slicing."""
      import pygac.utils
  
      pygac.utils.check_user_scanlines.return_value = 1, 2
      pygac.utils.slice_channel.return_value = "sliced"
      strip_invalid_lat.return_value = 3, 4
      get_qual_flags.return_value = "qual_flags"
  
      data = np.zeros((2, 2))
  
      # a) Only start/end line given
      fh = _get_fh_mocked(
          start_line=5, end_line=6, strip_invalid_coords=False
      )
      data_slc = fh._slice(data)
      assert data_slc == "sliced"
      pygac.utils.check_user_scanlines.assert_called_with(
          start_line=5,
          end_line=6,
          first_valid_lat=None,
          last_valid_lat=None,
          along_track=2,
      )
      pygac.utils.slice_channel.assert_called_with(
          data,
          start_line=1,
          end_line=2,
          first_valid_lat=None,
          last_valid_lat=None,
      )
  
      # b) Only strip_invalid_coords=True
      fh = _get_fh_mocked(
          start_line=None, end_line=None, strip_invalid_coords=True
      )
      fh._slice(data)
      pygac.utils.check_user_scanlines.assert_called_with(
          start_line=0,
          end_line=0,
          first_valid_lat=3,
          last_valid_lat=4,
          along_track=2,
      )
  
      # c) Both
      fh = _get_fh_mocked(
          start_line=5, end_line=6, strip_invalid_coords=True
      )
      fh._slice(data)
      pygac.utils.check_user_scanlines.assert_called_with(
          start_line=5,
          end_line=6,
          first_valid_lat=3,
          last_valid_lat=4,
          along_track=2,
      )
  
      # Test slicing with older pygac versions
      pygac.utils.slice_channel.return_value = ("sliced", "foo", "bar")
      data_slc = fh._slice(data)
      assert data_slc == "sliced"
  
imports: from datetime import datetime
  from unittest import TestCase, mock
  import dask.array
  import numpy
  import pytest
  import xarray
label_desc: Use image node_id 12 for calling the TestGACLACFile obj's underlying member method code with example usage: obj.test__slice(strip_invalid_lat, get_qual_flags) without return types