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

Method test_sni_callback

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

Source from the content-addressed store, hash-verified

1397 self.assertRaises(ValueError, ctx.set_ecdh_curve, b"foo")
1398
1399 def test_sni_callback(self):
1400 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
1401
1402 # set_servername_callback expects a callable, or None
1403 self.assertRaises(TypeError, ctx.set_servername_callback)
1404 self.assertRaises(TypeError, ctx.set_servername_callback, 4)
1405 self.assertRaises(TypeError, ctx.set_servername_callback, "")
1406 self.assertRaises(TypeError, ctx.set_servername_callback, ctx)
1407
1408 def dummycallback(sock, servername, ctx):
1409 pass
1410 ctx.set_servername_callback(None)
1411 ctx.set_servername_callback(dummycallback)
1412
1413 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: <SSLContext(protocol=17)> is not None
1414 def test_sni_callback_refcycle(self):

Callers

nothing calls this directly

Calls 2

assertRaisesMethod · 0.45

Tested by

no test coverage detected