mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Issue #21068: The ssl.PROTOCOL* constants are now enum members.
This commit is contained in:
parent
1226db4651
commit
172f025bed
3 changed files with 18 additions and 19 deletions
|
@ -134,6 +134,14 @@ class BasicSocketTests(unittest.TestCase):
|
|||
self.assertIn(ssl.HAS_SNI, {True, False})
|
||||
self.assertIn(ssl.HAS_ECDH, {True, False})
|
||||
|
||||
def test_str_for_enums(self):
|
||||
# Make sure that the PROTOCOL_* constants have enum-like string
|
||||
# reprs.
|
||||
proto = ssl.PROTOCOL_SSLv3
|
||||
self.assertEqual(str(proto), '_SSLMethod.PROTOCOL_SSLv3')
|
||||
ctx = ssl.SSLContext(proto)
|
||||
self.assertIs(ctx.protocol, proto)
|
||||
|
||||
def test_random(self):
|
||||
v = ssl.RAND_status()
|
||||
if support.verbose:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue