MCPcopy
hub / github.com/cherrypy/cherrypy / cp_native_server

Function cp_native_server

cherrypy/test/test_native.py:16–30  ·  view source on GitHub ↗

A native server.

(request)

Source from the content-addressed store, hash-verified

14
15@pytest.fixture
16def cp_native_server(request):
17 """A native server."""
18 class Root(object):
19 @cherrypy.expose
20 def index(self):
21 return 'Hello World!'
22
23 cls = cherrypy._cpnative_server.CPHTTPServer
24 cherrypy.server.httpserver = cls(cherrypy.server)
25
26 cherrypy.tree.mount(Root(), '/')
27 cherrypy.engine.start()
28 request.addfinalizer(cherrypy.engine.stop)
29 url = 'http://localhost:{cherrypy.server.socket_port}'.format(**globals())
30 return sessions.BaseUrlSession(url)
31
32
33def test_basic_request(cp_native_server):

Callers

nothing calls this directly

Calls 4

mountMethod · 0.80
formatMethod · 0.80
RootClass · 0.70
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…