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