MCPcopy
hub / github.com/tornadoweb/tornado / test_check_hostname

Method test_check_hostname

tornado/test/iostream_test.py:1079–1091  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1077
1078 @gen_test
1079 def test_check_hostname(self):
1080 # Test that server_hostname parameter to start_tls is being used.
1081 server_future = self.server_start_tls(_server_ssl_options())
1082 with ExpectLog(gen_log, "SSL Error"):
1083 client_future = self.client_start_tls(
1084 ssl.create_default_context(), server_hostname="127.0.0.1"
1085 )
1086 with self.assertRaises(ssl.SSLError):
1087 # The client fails to connect with an SSL error.
1088 yield client_future
1089 with self.assertRaises(Exception):
1090 # The server fails to connect, but the exact error is unspecified.
1091 yield server_future
1092
1093 @gen_test
1094 def test_typed_memoryview(self):

Callers

nothing calls this directly

Calls 4

server_start_tlsMethod · 0.95
client_start_tlsMethod · 0.95
ExpectLogClass · 0.90
_server_ssl_optionsFunction · 0.85

Tested by

no test coverage detected