mirror of
https://github.com/python/cpython.git
synced 2025-08-30 05:35:08 +00:00
Issue 18693: Put custom __dir__ back in place. Will instead look at fixing help()
.
This commit is contained in:
parent
8f2c2bcc9d
commit
388a3921cf
2 changed files with 21 additions and 0 deletions
|
@ -67,6 +67,21 @@ class TestEnum(unittest.TestCase):
|
|||
WINTER = 4
|
||||
self.Season = Season
|
||||
|
||||
def test_dir_on_class(self):
|
||||
Season = self.Season
|
||||
self.assertEqual(
|
||||
set(dir(Season)),
|
||||
set(['__class__', '__doc__', '__members__',
|
||||
'SPRING', 'SUMMER', 'AUTUMN', 'WINTER']),
|
||||
)
|
||||
|
||||
def test_dir_on_item(self):
|
||||
Season = self.Season
|
||||
self.assertEqual(
|
||||
set(dir(Season.WINTER)),
|
||||
set(['__class__', '__doc__', 'name', 'value']),
|
||||
)
|
||||
|
||||
def test_enum_in_enum_out(self):
|
||||
Season = self.Season
|
||||
self.assertIs(Season(Season.WINTER), Season.WINTER)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue