MCPcopy Index your code
hub / github.com/python/cpython / test_constructor

Method test_constructor

Lib/test/test_ssl.py:996–1006  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

994class ContextTests(unittest.TestCase):
995
996 def test_constructor(self):
997 for protocol in PROTOCOLS:
998 if has_tls_protocol(protocol):
999 with warnings_helper.check_warnings():
1000 ctx = ssl.SSLContext(protocol)
1001 self.assertEqual(ctx.protocol, protocol)
1002 with warnings_helper.check_warnings():
1003 ctx = ssl.SSLContext()
1004 self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLS)
1005 self.assertRaises(ValueError, ssl.SSLContext, -1)
1006 self.assertRaises(ValueError, ssl.SSLContext, 42)
1007
1008 def test_ciphers(self):
1009 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

Callers

nothing calls this directly

Calls 3

has_tls_protocolFunction · 0.85
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected