MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_timeout

Method test_timeout

python/python3/tornado/test/httpserver_test.py:1287–1301  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1285
1286 @gen_test
1287 def test_timeout(self):
1288 stream = IOStream(socket.socket())
1289 try:
1290 yield stream.connect(("127.0.0.1", self.get_http_port()))
1291 # Use a raw stream because AsyncHTTPClient won't let us read a
1292 # response without finishing a body.
1293 stream.write(
1294 b"PUT /streaming?body_timeout=0.1 HTTP/1.0\r\n"
1295 b"Content-Length: 42\r\n\r\n"
1296 )
1297 with ExpectLog(gen_log, "Timeout reading body", level=logging.INFO):
1298 response = yield stream.read_until_close()
1299 self.assertEqual(response, b"")
1300 finally:
1301 stream.close()
1302
1303 @gen_test
1304 def test_body_size_override_reset(self):

Callers

nothing calls this directly

Calls 7

connectMethod · 0.95
IOStreamClass · 0.90
ExpectLogClass · 0.90
get_http_portMethod · 0.80
read_until_closeMethod · 0.80
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected