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

Method test_non_ssl_request

tornado/test/httpserver_test.py:120–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

118 self.assertEqual(response.body, b"Got 5000 bytes in POST")
119
120 def test_non_ssl_request(self):
121 # Make sure the server closes the connection when it gets a non-ssl
122 # connection, rather than waiting for a timeout or otherwise
123 # misbehaving.
124 with ExpectLog(gen_log, "(SSL Error|uncaught exception)"):
125 with ExpectLog(gen_log, "Uncaught exception", required=False):
126 with self.assertRaises((IOError, HTTPError)): # type: ignore
127 self.fetch(
128 self.get_url("/").replace("https:", "http:"),
129 request_timeout=3600,
130 connect_timeout=3600,
131 raise_error=True,
132 )
133
134 def test_error_logging(self):
135 # No stack traces are logged for SSL errors.

Callers

nothing calls this directly

Calls 4

ExpectLogClass · 0.90
replaceMethod · 0.80
fetchMethod · 0.45
get_urlMethod · 0.45

Tested by

no test coverage detected