Mercurial > cpython-lru_cache-weakref
diff Lib/test/test_enum.py @ 85707:24aa6f98fe25
Add __reversed__ to Enum. Minor code reorg (moved __members__ to be in alpha order).
| author | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| date | Sat, 14 Sep 2013 18:11:24 -0700 |
| parents | 1d88d04aade2 |
| children | 54ddd1124df8 |
line wrap: on
line diff
--- a/Lib/test/test_enum.py Sun Sep 15 04:05:04 2013 +0300 +++ b/Lib/test/test_enum.py Sat Sep 14 18:11:24 2013 -0700 @@ -477,6 +477,13 @@ [Season.SUMMER, Season.WINTER, Season.AUTUMN, Season.SPRING], ) + def test_reversed_iteration_order(self): + self.assertEqual( + list(reversed(self.Season)), + [self.Season.WINTER, self.Season.AUTUMN, self.Season.SUMMER, + self.Season.SPRING] + ) + def test_programatic_function_string(self): SummerMonth = Enum('SummerMonth', 'june july august') lst = list(SummerMonth)
