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

Method test_sni_callback_raising

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

Source from the content-addressed store, hash-verified

4275
4276 @unittest.expectedFailure # TODO: RUSTPYTHON
4277 def test_sni_callback_raising(self):
4278 # Raising fails the connection with a TLS handshake failure alert.
4279 server_context, other_context, client_context = self.sni_contexts()
4280
4281 def cb_raising(ssl_sock, server_name, initial_context):
4282 1/0
4283 server_context.set_servername_callback(cb_raising)
4284
4285 with support.catch_unraisable_exception() as catch:
4286 with self.assertRaises(ssl.SSLError) as cm:
4287 stats = server_params_test(client_context, server_context,
4288 chatty=False,
4289 sni_name='supermessage')
4290
4291 # Allow for flexible libssl error messages.
4292 regex = "(SSLV3_ALERT_HANDSHAKE_FAILURE|NO_PRIVATE_VALUE)"
4293 self.assertRegex(cm.exception.reason, regex)
4294 self.assertEqual(catch.unraisable.exc_type, ZeroDivisionError)
4295
4296 @unittest.expectedFailure # TODO: RUSTPYTHON; AttributeError: 'SSLEOFError' object has no attribute 'reason'
4297 def test_sni_callback_wrong_return_type(self):

Callers

nothing calls this directly

Calls 6

sni_contextsMethod · 0.95
server_params_testFunction · 0.85
assertRegexMethod · 0.80
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected