MCPcopy Index your code
hub / github.com/RustPython/RustPython / _assert_context_options

Method _assert_context_options

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

Source from the content-addressed store, hash-verified

1506 self.assertEqual(ctx.cert_store_stats(), stats)
1507
1508 def _assert_context_options(self, ctx):
1509 self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2)
1510 if OP_NO_COMPRESSION != 0:
1511 self.assertEqual(ctx.options & OP_NO_COMPRESSION,
1512 OP_NO_COMPRESSION)
1513 if OP_SINGLE_DH_USE != 0:
1514 self.assertEqual(ctx.options & OP_SINGLE_DH_USE,
1515 OP_SINGLE_DH_USE)
1516 if OP_SINGLE_ECDH_USE != 0:
1517 self.assertEqual(ctx.options & OP_SINGLE_ECDH_USE,
1518 OP_SINGLE_ECDH_USE)
1519 if OP_CIPHER_SERVER_PREFERENCE != 0:
1520 self.assertEqual(ctx.options & OP_CIPHER_SERVER_PREFERENCE,
1521 OP_CIPHER_SERVER_PREFERENCE)
1522 self.assertEqual(ctx.options & ssl.OP_LEGACY_SERVER_CONNECT,
1523 0 if IS_OPENSSL_3_0_0 else ssl.OP_LEGACY_SERVER_CONNECT)
1524
1525 def test_create_default_context(self):
1526 ctx = ssl.create_default_context()

Callers 2

Calls 1

assertEqualMethod · 0.45

Tested by

no test coverage detected