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

Method test_version_basic

Lib/test/test_ssl.py:3880–3897  ·  view source on GitHub ↗

Basic tests for SSLSocket.version(). More tests are done in the test_protocol_*() methods.

(self)

Source from the content-addressed store, hash-verified

3878 self.assertIn("NO_SHARED_CIPHER", server.conn_errors[0])
3879
3880 def test_version_basic(self):
3881 """
3882 Basic tests for SSLSocket.version().
3883 More tests are done in the test_protocol_*() methods.
3884 """
3885 context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
3886 context.check_hostname = False
3887 context.verify_mode = ssl.CERT_NONE
3888 with ThreadedEchoServer(CERTFILE,
3889 ssl_version=ssl.PROTOCOL_TLS_SERVER,
3890 chatty=False) as server:
3891 with context.wrap_socket(socket.socket()) as s:
3892 self.assertIs(s.version(), None)
3893 self.assertIs(s._sslobj, None)
3894 s.connect((HOST, server.port))
3895 self.assertEqual(s.version(), 'TLSv1.3')
3896 self.assertIs(s._sslobj, None)
3897 self.assertIs(s.version(), None)
3898
3899 @requires_tls_version('TLSv1_3')
3900 def test_tls1_3(self):

Callers

nothing calls this directly

Calls 7

wrap_socketMethod · 0.95
ThreadedEchoServerClass · 0.85
socketMethod · 0.80
assertIsMethod · 0.45
versionMethod · 0.45
connectMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected