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

Method _assert_context_options

Lib/test/test_ssl.py:1691–1706  ·  view source on GitHub ↗
(self, ctx)

Source from the content-addressed store, hash-verified

1689 self.assertEqual(ctx.cert_store_stats(), stats)
1690
1691 def _assert_context_options(self, ctx):
1692 self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
1693 if OP_NO_COMPRESSION != 0:
1694 self.assertEqual(ctx.options & OP_NO_COMPRESSION,
1695 OP_NO_COMPRESSION)
1696 if OP_SINGLE_DH_USE != 0:
1697 self.assertEqual(ctx.options & OP_SINGLE_DH_USE,
1698 OP_SINGLE_DH_USE)
1699 if OP_SINGLE_ECDH_USE != 0:
1700 self.assertEqual(ctx.options & OP_SINGLE_ECDH_USE,
1701 OP_SINGLE_ECDH_USE)
1702 if OP_CIPHER_SERVER_PREFERENCE != 0:
1703 self.assertEqual(ctx.options & OP_CIPHER_SERVER_PREFERENCE,
1704 OP_CIPHER_SERVER_PREFERENCE)
1705 self.assertEqual(ctx.options & ssl.OP_LEGACY_SERVER_CONNECT,
1706 0 if IS_OPENSSL_3_0_0 else ssl.OP_LEGACY_SERVER_CONNECT)
1707
1708 def test_create_default_context(self):
1709 ctx = ssl.create_default_context()

Callers 2

Calls 1

assertEqualMethod · 0.45

Tested by

no test coverage detected