mirror of
https://github.com/python/cpython.git
synced 2025-10-05 06:31:48 +00:00
This commit is contained in:
parent
0e1f9e8d3e
commit
504b95047a
3 changed files with 24 additions and 1 deletions
|
@ -2291,6 +2291,26 @@ class TestIntFlag(unittest.TestCase):
|
|||
self.assertIs(type(e), Perm)
|
||||
|
||||
|
||||
def test_programatic_function_from_empty_list(self):
|
||||
Perm = enum.IntFlag('Perm', [])
|
||||
lst = list(Perm)
|
||||
self.assertEqual(len(lst), len(Perm))
|
||||
self.assertEqual(len(Perm), 0, Perm)
|
||||
Thing = enum.Enum('Thing', [])
|
||||
lst = list(Thing)
|
||||
self.assertEqual(len(lst), len(Thing))
|
||||
self.assertEqual(len(Thing), 0, Thing)
|
||||
|
||||
|
||||
def test_programatic_function_from_empty_tuple(self):
|
||||
Perm = enum.IntFlag('Perm', ())
|
||||
lst = list(Perm)
|
||||
self.assertEqual(len(lst), len(Perm))
|
||||
self.assertEqual(len(Perm), 0, Perm)
|
||||
Thing = enum.Enum('Thing', ())
|
||||
self.assertEqual(len(lst), len(Thing))
|
||||
self.assertEqual(len(Thing), 0, Thing)
|
||||
|
||||
def test_containment(self):
|
||||
Perm = self.Perm
|
||||
R, W, X = Perm
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue