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

Method test_get_ciphers

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

Source from the content-addressed store, hash-verified

1026 self.assertNotIn("3DES", name)
1027
1028 def test_get_ciphers(self):
1029 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
1030 ctx.set_ciphers('AESGCM')
1031 names = set(d['name'] for d in ctx.get_ciphers())
1032 expected = {
1033 'AES128-GCM-SHA256',
1034 'ECDHE-ECDSA-AES128-GCM-SHA256',
1035 'ECDHE-RSA-AES128-GCM-SHA256',
1036 'DHE-RSA-AES128-GCM-SHA256',
1037 'AES256-GCM-SHA384',
1038 'ECDHE-ECDSA-AES256-GCM-SHA384',
1039 'ECDHE-RSA-AES256-GCM-SHA384',
1040 'DHE-RSA-AES256-GCM-SHA384',
1041 }
1042 intersection = names.intersection(expected)
1043 self.assertGreaterEqual(
1044 len(intersection), 2, f"\ngot: {sorted(names)}\nexpected: {sorted(expected)}"
1045 )
1046
1047 def test_set_groups(self):
1048 ctx = ssl.create_default_context()

Callers

nothing calls this directly

Calls 3

setFunction · 0.85
assertGreaterEqualMethod · 0.80
intersectionMethod · 0.45

Tested by

no test coverage detected