(self)
| 129 | example.color = value |
| 130 | |
| 131 | def test_ctor_without_default_value(self): |
| 132 | # -- IMPLICIT: default_value = Color.red (first enum-value) |
| 133 | class Example2(HasTraits): |
| 134 | color = UseEnum(Color) |
| 135 | |
| 136 | example = Example2() |
| 137 | self.assertEqual(example.color, Color.red) |
| 138 | |
| 139 | def test_ctor_with_default_value_as_enum_value(self): |
| 140 | # -- CONVERT: number => Enum value (item) |