code: def test_get_colorscale(self):
      # test for incorrect input type
      pattern = "Name argument have to be a string."
      name = colors.sequential.haline
  
      self.assertRaisesRegex(
          PlotlyError, pattern, colors.get_colorscale, name
      )
  
      # test for non-existing colorscale
      pattern = r"Colorscale \S+ is not a built-in scale."
      name = "foo"
      self.assertRaisesRegex(
          PlotlyError, pattern, colors.get_colorscale, name
      )
  
      # test non-capitalised access
      self.assertEqual(
          colors.make_colorscale(colors.sequential.haline),
          colors.get_colorscale("haline"),
      )
      # test capitalised access
      self.assertEqual(
          colors.make_colorscale(colors.diverging.Earth),
          colors.get_colorscale("Earth"),
      )
      # test accessing non-capitalised scale with capitalised name
      self.assertEqual(
          colors.make_colorscale(colors.cyclical.mrybm),
          colors.get_colorscale("Mrybm"),
      )
      # test accessing capitalised scale with non-capitalised name
      self.assertEqual(
          colors.make_colorscale(colors.sequential.Viridis),
          colors.get_colorscale("viridis"),
      )
      # test accessing reversed scale
      self.assertEqual(
          colors.make_colorscale(colors.diverging.Portland_r),
          colors.get_colorscale("portland_r"),
      )
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_core/test_colors/test_colors.py
imports: from unittest import TestCase
  import plotly.tools
  from plotly.exceptions import PlotlyError
  import plotly.colors
label_desc: Use image node_id 6 for calling the TestColors obj's underlying member method code with example usage: obj.test_get_colorscale() without return types