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

Method test_get_ciphers

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

Source from the content-addressed store, hash-verified

945 self.assertNotIn("3DES", name)
946
947 def test_get_ciphers(self):
948 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
949 ctx.set_ciphers('AESGCM')
950 names = set(d['name'] for d in ctx.get_ciphers())
951 expected = {
952 'AES128-GCM-SHA256',
953 'ECDHE-ECDSA-AES128-GCM-SHA256',
954 'ECDHE-RSA-AES128-GCM-SHA256',
955 'DHE-RSA-AES128-GCM-SHA256',
956 'AES256-GCM-SHA384',
957 'ECDHE-ECDSA-AES256-GCM-SHA384',
958 'ECDHE-RSA-AES256-GCM-SHA384',
959 'DHE-RSA-AES256-GCM-SHA384',
960 }
961 intersection = names.intersection(expected)
962 self.assertGreaterEqual(
963 len(intersection), 2, f"\ngot: {sorted(names)}\nexpected: {sorted(expected)}"
964 )
965
966 def test_options(self):
967 # Test default SSLContext options

Callers

nothing calls this directly

Calls 7

setFunction · 0.85
lenFunction · 0.85
sortedFunction · 0.85
assertGreaterEqualMethod · 0.80
set_ciphersMethod · 0.45
get_ciphersMethod · 0.45
intersectionMethod · 0.45

Tested by

no test coverage detected