summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_enum.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_enum.py b/Lib/test/test_enum.py
index cfe1b18..cf704ed 100644
--- a/Lib/test/test_enum.py
+++ b/Lib/test/test_enum.py
@@ -1767,6 +1767,14 @@ class TestFlag(unittest.TestCase):
self.assertIs(Open.WO & ~Open.WO, Open.RO)
self.assertIs((Open.WO|Open.CE) & ~Open.WO, Open.CE)
+ def test_bool(self):
+ Perm = self.Perm
+ for f in Perm:
+ self.assertTrue(f)
+ Open = self.Open
+ for f in Open:
+ self.assertEqual(bool(f.value), bool(f))
+
def test_programatic_function_string(self):
Perm = Flag('Perm', 'R W X')
lst = list(Perm)
@@ -2137,6 +2145,14 @@ class TestIntFlag(unittest.TestCase):
self.assertFalse(W in RX)
self.assertFalse(X in RW)
+ def test_bool(self):
+ Perm = self.Perm
+ for f in Perm:
+ self.assertTrue(f)
+ Open = self.Open
+ for f in Open:
+ self.assertEqual(bool(f.value), bool(f))
+
class TestUnique(unittest.TestCase):
def test_unique_clean(self):