cherrypy.test.helper module¶
A library of helper functions for the CherryPy test suite.
-
class
cherrypy.test.helper.
CPProcess
(wait=False, daemonize=False, ssl=False, socket_host=None, socket_port=None)[source]¶ Bases:
object
-
access_log
= '/home/docs/checkouts/readthedocs.org/user_builds/cherrypy/envs/latest/lib/python3.6/site-packages/cherrypy/test/test.access.log'¶
-
config_file
= '/home/docs/checkouts/readthedocs.org/user_builds/cherrypy/envs/latest/lib/python3.6/site-packages/cherrypy/test/test.conf'¶
-
config_template
= "[global]\nserver.socket_host: '%(host)s'\nserver.socket_port: %(port)s\nchecker.on: False\nlog.screen: False\nlog.error_file: r'%(error_log)s'\nlog.access_file: r'%(access_log)s'\n%(ssl)s\n%(extra)s\n"¶
-
error_log
= '/home/docs/checkouts/readthedocs.org/user_builds/cherrypy/envs/latest/lib/python3.6/site-packages/cherrypy/test/test.error.log'¶
-
pid_file
= '/home/docs/checkouts/readthedocs.org/user_builds/cherrypy/envs/latest/lib/python3.6/site-packages/cherrypy/test/test.pid'¶
-
-
class
cherrypy.test.helper.
CPWebCase
(methodName='runTest')[source]¶ Bases:
cheroot.test.webtest.WebCase
-
assertErrorPage
(status, message=None, pattern='')[source]¶ Compare the response body with a built in error page.
The function will optionally look for the regexp pattern, within the exception embedded in the error page.
-
available_servers
= {'cpmodpy': <function get_cpmodpy_supervisor>, 'modfastcgi': <function get_modfastcgi_supervisor>, 'modfcgid': <function get_modfcgid_supervisor>, 'modpygw': <function get_modpygw_supervisor>, 'modwsgi': <function get_modwsgi_supervisor>, 'native': <class 'cherrypy.test.helper.NativeServerSupervisor'>, 'wsgi': <class 'cherrypy.test.helper.LocalWSGISupervisor'>, 'wsgi_u': <function get_wsgi_u_supervisor>}¶
-
date_tolerance
= 2¶
-
default_server
= 'wsgi'¶
-
do_gc_test
= False¶
-
scheme
= 'http'¶
-
script_name
= ''¶
-
-
class
cherrypy.test.helper.
LocalSupervisor
(**kwargs)[source]¶ Bases:
cherrypy.test.helper.Supervisor
Base class for modeling/controlling servers which run in the same process.
When the server side runs in a different process, start/stop can dump all state between each test module easily. When the server side runs in the same process as the client, however, we have to do a bit more work to ensure config and mounted apps are reset between tests.
-
using_apache
= False¶
-
using_wsgi
= False¶
-
-
class
cherrypy.test.helper.
LocalWSGISupervisor
(**kwargs)[source]¶ Bases:
cherrypy.test.helper.LocalSupervisor
Server supervisor for the builtin WSGI server.
-
httpserver_class
= 'cherrypy._cpwsgi_server.CPWSGIServer'¶
-
using_apache
= False¶
-
using_wsgi
= True¶
-
-
class
cherrypy.test.helper.
NativeServerSupervisor
(**kwargs)[source]¶ Bases:
cherrypy.test.helper.LocalSupervisor
Server supervisor for the builtin HTTP server.
-
httpserver_class
= 'cherrypy._cpnative_server.CPHTTPServer'¶
-
using_apache
= False¶
-
using_wsgi
= False¶
-
-
class
cherrypy.test.helper.
Supervisor
(**kwargs)[source]¶ Bases:
object
Base class for modeling and controlling servers during testing.