Close #19252: better test coverage for Enum. Thanks, CliffM

This commit is contained in:
Ethan Furman 2013-10-16 19:09:31 -07:00
parent 1f2eaa97eb
commit 1a16288197
1 changed files with 4 additions and 2 deletions

View File

@ -1139,8 +1139,10 @@ class TestEnum(unittest.TestCase):
green = ()
blue = ()
self.assertEqual(list(ColorInAList), [ColorInAList.red, ColorInAList.green, ColorInAList.blue])
self.assertEqual(ColorInAList.red.value, [1])
self.assertEqual(ColorInAList([1]), ColorInAList.red)
for enum, value in zip(ColorInAList, range(3)):
value += 1
self.assertEqual(enum.value, [value])
self.assertIs(ColorInAList([value]), enum)
def test_conflicting_types_resolved_in_new(self):
class LabelledIntEnum(int, Enum):