(self)
| 994 | class 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) |
nothing calls this directly
no test coverage detected