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

Method test_timeout

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

Source from the content-addressed store, hash-verified

1465
1466 @gen_test
1467 def test_timeout(self):
1468 stream = IOStream(socket.socket())
1469 try:
1470 yield stream.connect(("127.0.0.1", self.get_http_port()))
1471 # Use a raw stream because AsyncHTTPClient won't let us read a
1472 # response without finishing a body.
1473 stream.write(
1474 b"PUT /streaming?body_timeout=0.1 HTTP/1.0\r\n"
1475 b"Content-Length: 42\r\n\r\n"
1476 )
1477 with ExpectLog(gen_log, "Timeout reading body", level=logging.INFO):
1478 response = yield stream.read_until_close()
1479 self.assertEqual(response, b"")
1480 finally:
1481 stream.close()
1482
1483 @gen_test
1484 def test_body_size_override_reset(self):

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected