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

Class ConnectionDelegate

python/python3/tornado/test/routing_test.py:164–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162
163
164class ConnectionDelegate(HTTPServerConnectionDelegate):
165 def start_request(self, server_conn, request_conn):
166 class MessageDelegate(HTTPMessageDelegate):
167 def __init__(self, connection):
168 self.connection = connection
169
170 def finish(self):
171 response_body = b"OK"
172 self.connection.write_headers(
173 ResponseStartLine("HTTP/1.1", 200, "OK"),
174 HTTPHeaders({"Content-Length": str(len(response_body))}),
175 )
176 self.connection.write(response_body)
177 self.connection.finish()
178
179 return MessageDelegate(request_conn)
180
181
182class RuleRouterTest(AsyncHTTPTestCase):

Callers 1

get_appMethod · 0.85

Calls

no outgoing calls

Tested by 1

get_appMethod · 0.68