summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2013-09-15 01:11:24 (GMT)
committerEthan Furman <ethan@stoneleaf.us>2013-09-15 01:11:24 (GMT)
commit2131a4a2fc933132c8f2b1f97b3bbf246cccc669 (patch)
treed3c00a2914f976802467faabe45918fdb92f2714 /Lib/test/test_enum.py
parent5589bd109adf9cdf1eec9ad78d4250b9f9b078ea (diff)
downloadcpython-2131a4a2fc933132c8f2b1f97b3bbf246cccc669.zip
cpython-2131a4a2fc933132c8f2b1f97b3bbf246cccc669.tar.gz
cpython-2131a4a2fc933132c8f2b1f97b3bbf246cccc669.tar.bz2
Add __reversed__ to Enum. Minor code reorg (moved __members__ to be in alpha order).
Diffstat (limited to 'Lib/test/test_enum.py')
-rw-r--r--Lib/test/test_enum.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index 018e3fd..1308003 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -477,6 +477,13 @@ class TestEnum(unittest.TestCase):
[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)