diff options
author | Zachary Ware <zachary.ware@gmail.com> | 2015-12-21 14:17:12 -0600 |
---|---|---|
committer | Zachary Ware <zachary.ware@gmail.com> | 2015-12-21 14:17:12 -0600 |
commit | f2b234443c53cb73dc749da57d952286437cb15a (patch) | |
tree | f21b8b25f5bfbe76a2c85ae62f6d06060dd03372 /Lib/test/test_enum.py | |
parent | 26b842a82d9ae7d30c692080bf352a0ef78a626c (diff) | |
parent | 977fd6d7c6593680fd5ffdebb262a2a3f2f24387 (diff) | |
download | cpython-f2b234443c53cb73dc749da57d952286437cb15a.tar.gz |
Issue #25827: Merge with 3.5
Diffstat (limited to 'Lib/test/test_enum.py')
-rw-r--r-- | Lib/test/test_enum.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py index 4b5d0d07bc..e4e6c2b51a 100644 --- a/Lib/test/test_enum.py +++ b/Lib/test/test_enum.py @@ -6,6 +6,7 @@ from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, unique from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL +from test import support # for pickle tests try: @@ -270,6 +271,13 @@ class TestEnum(unittest.TestCase): class Wrong(Enum): _any_name_ = 9 + def test_bool(self): + class Logic(Enum): + true = True + false = False + self.assertTrue(Logic.true) + self.assertFalse(Logic.false) + def test_contains(self): Season = self.Season self.assertIn(Season.AUTUMN, Season) @@ -1701,5 +1709,11 @@ class TestStdLib(unittest.TestCase): if failed: self.fail("result does not equal expected, see print above") + +class MiscTestCase(unittest.TestCase): + def test__all__(self): + support.check__all__(self, enum) + + if __name__ == '__main__': unittest.main() |