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

Method test_context_custom_class

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

Source from the content-addressed store, hash-verified

1633 self.assertEqual(ctx.verify_mode, ssl.CERT_NONE)
1634
1635 def test_context_custom_class(self):
1636 class MySSLSocket(ssl.SSLSocket):
1637 pass
1638
1639 class MySSLObject(ssl.SSLObject):
1640 pass
1641
1642 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
1643 ctx.sslsocket_class = MySSLSocket
1644 ctx.sslobject_class = MySSLObject
1645
1646 with ctx.wrap_socket(socket.socket(), server_side=True) as sock:
1647 self.assertIsInstance(sock, MySSLSocket)
1648 obj = ctx.wrap_bio(ssl.MemoryBIO(), ssl.MemoryBIO(), server_side=True)
1649 self.assertIsInstance(obj, MySSLObject)
1650
1651 def test_num_tickest(self):
1652 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)

Callers

nothing calls this directly

Calls 4

wrap_socketMethod · 0.95
wrap_bioMethod · 0.95
socketMethod · 0.80
assertIsInstanceMethod · 0.80

Tested by

no test coverage detected