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