| 1904 | |
| 1905 | def test_raise_custom_error_on_creation(self): |
| 1906 | class InvalidRgbColorError(ValueError): |
| 1907 | def __init__(self, r, g, b): |
| 1908 | self.r = r |
| 1909 | self.g = g |
| 1910 | self.b = b |
| 1911 | super().__init__(f'({r}, {g}, {b}) is not a valid RGB color') |
| 1912 | |
| 1913 | with self.assertRaises(InvalidRgbColorError): |
| 1914 | class RgbColor(Enum): |