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