MCPcopy
hub / github.com/aio-libs/aiohttp / create_server

Method create_server

tests/test_connector.py:710–720  ·  tests/test_connector.py::TestHttpClientConnector.create_server
(self, method, path, handler)

Source from the content-addressed store, hash-verified

708
709 @asyncio.coroutine
710 def create_server(self, method, path, handler):
711 app = web.Application(loop=self.loop)
712 app.router.add_route(method, path, handler)
713
714 port = self.find_unused_port()
715 self.handler = app.make_handler(keep_alive_on=False)
716 srv = yield from self.loop.create_server(
717 self.handler, &class="cm">#x27;127.0.0.1', port)
718 url = class="st">"http://127.0.0.1:{}".format(port) + path
719 self.addCleanup(srv.close)
720 return app, srv, url
721
722 @asyncio.coroutine
723 def create_unix_server(self, method, path, handler):

Calls 3

find_unused_portMethod · 0.95
make_handlerMethod · 0.95
add_routeMethod · 0.45

Tested by

no test coverage detected