class_docstr: Test generic image reader.
class_docstr_tok: ["Test","generic","image","reader","."]
docstr: Test direct use of the reader.
docstr_tok: ["Test","direct","use","of","the","reader","."]
code: def test_GenericImageFileHandler_masking_only_integer(self):
      """Test direct use of the reader."""
      from satpy.readers.generic_image import GenericImageFileHandler
  
      class FakeGenericImageFileHandler(GenericImageFileHandler):
          def __init__(
              self,
              filename,
              filename_info,
              filetype_info,
              file_content,
              **kwargs,
          ):
              """Get fake file content from 'get_test_content'."""
              super(GenericImageFileHandler, self).__init__(
                  filename, filename_info, filetype_info
              )
              self.file_content = file_content
              self.dataset_name = None
              self.file_content.update(kwargs)
  
      data = self.scn["rgba"]
  
      # do nothing if not integer
      float_data = data / 255.0
      reader = FakeGenericImageFileHandler(
          "dummy", {}, {}, {"image": float_data}
      )
      assert (
          reader.get_dataset(make_dataid(name="image"), {})
          is float_data
      )
  
      # masking if integer
      data = data.astype(np.uint32)
      assert data.bands.size == 4
      reader = FakeGenericImageFileHandler(
          "dummy", {}, {}, {"image": data}
      )
      ret_data = reader.get_dataset(make_dataid(name="image"), {})
      assert ret_data.bands.size == 3
  
file_path: satpy/satpy/tests/reader_tests/test_generic_image.py
imports: import os
  import unittest
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.tests.utils import make_dataid
label_desc: Use image node_id 7 for calling the TestGenericImage obj's underlying member method code with example usage: obj.test_GenericImageFileHandler_masking_only_integer() without return types