def test_solid_color_not_tuple(self): with self.assertRaises(TypeError): plot_utils.make_linear_alpha_cmap('cmap', 'hello', 1, min_alpha=0, max_alpha=1)
def test_max_less_than_min_alpha(self): solid_color = plt.cm.jet(0.8) with self.assertRaises(ValueError): plot_utils.make_linear_alpha_cmap('cmap', solid_color, 1, min_alpha=1, max_alpha=0)
def test_max_alpha_not_num(self): solid_color = plt.cm.jet(0.8) with self.assertRaises(TypeError): plot_utils.make_linear_alpha_cmap('cmap', solid_color, 1, min_alpha=0, max_alpha='hello')
def test_solid_normalization_val_not_num(self): solid_color = plt.cm.jet(0.8) with self.assertRaises(TypeError): plot_utils.make_linear_alpha_cmap('cmap', solid_color, 'hello', min_alpha=0, max_alpha=1)
def test_solid_color_list_not_nums(self): solid_color = [0, 255, 'hello', 55] with self.assertRaises(TypeError): plot_utils.make_linear_alpha_cmap(5, solid_color, 1, min_alpha=0, max_alpha=1)
def test_solid_color_len_wrong(self): solid_color = [0, 255, 45] with self.assertRaises(ValueError): plot_utils.make_linear_alpha_cmap('cmap', solid_color, 1, min_alpha=0, max_alpha=1)
def test_name_not_str(self): solid_color = plt.cm.jet(0.8) with self.assertRaises(TypeError): plot_utils.make_linear_alpha_cmap(5, solid_color, 1, min_alpha=0, max_alpha=1)