MCPcopy
hub / github.com/sanic-org/sanic / _request

Function _request

tests/test_bad_request.py:12–22  ·  view source on GitHub ↗
(sanic, loop)

Source from the content-addressed store, hash-verified

10
11 @app.listener("after_server_start")
12 async def _request(sanic, loop):
13 nonlocal lines
14 connect = asyncio.open_connection("127.0.0.1", 42101)
15 reader, writer = await connect
16 writer.write(b"not http\r\n\r\n")
17 while True:
18 line = await reader.readline()
19 if not line:
20 break
21 lines.append(line)
22 app.stop()
23
24 app.run(host="127.0.0.1", port=42101, debug=False, single_process=True)
25 assert lines[0] == b"HTTP/1.1 400 Bad Request\r\n"

Callers

nothing calls this directly

Calls 3

writeMethod · 0.80
appendMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…