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

Method test_shared_ciphers

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

Source from the content-addressed store, hash-verified

4314 self.assertEqual(catch.unraisable.exc_type, TypeError)
4315
4316 def test_shared_ciphers(self):
4317 client_context, server_context, hostname = testing_context()
4318 client_context.set_ciphers("AES128:AES256")
4319 server_context.set_ciphers("AES256:eNULL")
4320 expected_algs = [
4321 "AES256", "AES-256",
4322 # TLS 1.3 ciphers are always enabled
4323 "TLS_CHACHA20", "TLS_AES",
4324 ]
4325
4326 stats = server_params_test(client_context, server_context,
4327 sni_name=hostname)
4328 ciphers = stats['server_shared_ciphers'][0]
4329 self.assertGreater(len(ciphers), 0)
4330 for name, tls_version, bits in ciphers:
4331 if not any(alg in name for alg in expected_algs):
4332 self.fail(name)
4333
4334 def test_read_write_after_close_raises_valuerror(self):
4335 client_context, server_context, hostname = testing_context()

Callers

nothing calls this directly

Calls 7

testing_contextFunction · 0.85
server_params_testFunction · 0.85
lenFunction · 0.85
assertGreaterMethod · 0.80
anyFunction · 0.50
set_ciphersMethod · 0.45
failMethod · 0.45

Tested by

no test coverage detected