class_docstr: Test utilities used with colormaps.
class_docstr_tok: ["Test","utilities","used","with","colormaps","."]
docstr: Test that reading colormaps with the wrong mode fails.
code: def test_cmap_bad_mode(self, real_mode, forced_mode, filename_suffix):
      """Test that reading colormaps with the wrong mode fails."""
      with closed_named_temp_file(
          suffix=filename_suffix
      ) as cmap_filename:
          cmap_data = _generate_cmap_test_data(None, real_mode)
          _write_cmap_to_file(cmap_filename, cmap_data)
          # Force colormap_mode VRGBA to RGBA and we should see an exception
          with pytest.raises(
              ValueError, match="Unexpected colormap shape for mode .*"
          ):
              create_colormap(
                  {
                      "filename": cmap_filename,
                      "colormap_mode": forced_mode,
                  }
              )
  
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 3 for calling the TestColormapLoading obj's underlying member method code with example usage: obj.test_cmap_bad_mode(real_mode, forced_mode, filename_suffix) without return types