Example #1
0
 def test_wrong_dtype(self):
     with self.assertRaises(TypeError):
         plot_utils.get_cmap_object(5)
Example #2
0
 def test_none(self):
     self.assertEqual(plt.cm.viridis, plot_utils.get_cmap_object(None))
Example #3
0
 def test_string_name(self):
     self.assertEqual(plt.cm.jet,
                      plot_utils.get_cmap_object(plt.get_cmap('jet')))
Example #4
0
 def test_cmap_not_cmap(self):
     with self.assertRaises(ValueError):
         plot_utils.get_cmap_object(cmap='hello')