class_docstr: Class for testing enhancements in satpy.enhancements.
class_docstr_tok: ["Class","for","testing","enhancements","in","satpy.enhancements","."]
docstr: Test the 'apply_enhancement' utility function.
code: def test_apply_enhancement(
      self, input_data_name, decorator, exp_call_cls
  ):
      """Test the 'apply_enhancement' utility function."""
  
      def _enh_func(img):
          def _calc_func(data):
              assert isinstance(data, exp_call_cls)
              return data
  
          decorated_func = decorator(_calc_func)
          return decorated_func(img.data)
  
      in_data = getattr(self, input_data_name)
      exp_data = in_data.values
      if "bands" not in in_data.coords:
          exp_data = exp_data[np.newaxis, :, :]
      run_and_check_enhancement(_enh_func, in_data, exp_data)
  
imports: import contextlib
  import os
  from tempfile import NamedTemporaryFile
  from unittest import mock
  import dask.array
  import numpy
  import pytest
  import xarray
  from satpy.enhancements import create_colormap, on_dask_array, on_separate_bands, using_map_blocks
label_desc: Use image node_id 2 for calling the TestEnhancementStretch obj's underlying member method code with example usage: obj.test_apply_enhancement(input_data_name, decorator, exp_call_cls) and returns: decorated_func, data