def test_get_color_rgba_changed(self): value_type = ConstantValue(color=Color()) with self.assertTraitChanges(value_type, 'updated'): value_type.color.rgba = (0.4, 0.2, 0.6, 0.8) self.assertEqual( value_type.get_color(self.model, [0], [0]), Color(rgba=(0.4, 0.2, 0.6, 0.8)) )
def test_get_color(self): value_type = ConstantValue(color='rebeccapurple') self.assertEqual( value_type.get_color(self.model, [0], [0]), Color(rgba=(0.4, 0.2, 0.6, 1.0)) )
def test_get_color_default(self): value_type = ConstantValue() self.assertIsNone(value_type.get_color(self.model, [0], [0]))