c.t.layers : module documentation

Part of canonical.testing

Layers used by Canonical tests.

Layers are the mechanism used by the Zope3 test runner to efficiently provide environments for tests and are documented in the lib/zope/testing.

Note that every Layer should define all of setUp, tearDown, testSetUp and testTearDown. If you don't do this, a base class' method will be called instead probably breaking something.

Preferred style is to not use the 'cls' argument to Layer class methods, as this is unambguious.

TODO: Make the Zope3 test runner handle multiple layers per test instead of one, forcing us to attempt to make some sort of layer tree. -- StuartBishop 20060619

Class LayerError Undocumented
Class LayerInvariantError Layer self checks have detected a fault. Invariant has been violated.
Class LayerIsolationError Test isolation has been broken, probably by the test we just ran.
Function is_ca_available Returns true if the component architecture has been loaded
Function disconnect_stores Disconnect Storm stores.
Function reconnect_stores Reconnect Storm stores, resetting the dbconfig to its defaults.
Function wait_children Wait for all children to exit.
Class BaseLayer Base layer.
Class MemcachedLayer Provides tests access to a memcached.
Class LibrarianLayer Provides tests access to a Librarian instance.
Class DatabaseLayer Provides tests access to the Launchpad sample database.
Function test_default_timeout Don't timeout by default in tests.
Class LaunchpadLayer Provides access to the Launchpad database and daemons.
Function wsgi_application This is a wsgi application for Zope functional testing.
Class FunctionalLayer Loads the Zope3 component architecture in appserver mode.
Class ZopelessLayer Layer for tests that need the Zopeless component architecture
Class TwistedLayer A layer for cleaning up the Twisted thread pool.
Class GoogleServiceLayer Tests for Google web service integration.
Class DatabaseFunctionalLayer Provides the database and the Zope3 application server environment.
Class LaunchpadFunctionalLayer Provides the Launchpad Zope3 application server environment.
Class GoogleLaunchpadFunctionalLayer Provides Google service in addition to LaunchpadFunctionalLayer.
Class ZopelessDatabaseLayer Testing layer for unit tests with no need for librarian.
Class LaunchpadScriptLayer Testing layer for scripts using the main Launchpad database adapter
Class LaunchpadZopelessLayer Full Zopeless environment including Component Architecture and
Class ExperimentalLaunchpadZopelessLayer LaunchpadZopelessLayer using the mock database.
Class MockHTTPTask Undocumented
Class PageTestLayer Environment for page tests.
Class TwistedLaunchpadZopelessLayer A layer for cleaning up the Twisted thread pool.
Class LayerProcessController Controller for starting and stopping subprocesses.
Class AppServerLayer Layer for tests that run in the webapp environment with an app server.
Class ZopelessAppServerLayer Layer for tests that run in the zopeless environment with an appserver.
Class TwistedAppServerLayer Layer for twisted-using zopeless tests that need a running app server.
Class BaseWindmillLayer Layer for Windmill tests.
def is_ca_available():
Returns true if the component architecture has been loaded
def disconnect_stores():
Disconnect Storm stores.
def reconnect_stores(database_config_section='launchpad'):
Reconnect Storm stores, resetting the dbconfig to its defaults.

After reconnecting, the database revision will be checked to make sure the right data is available.

def wait_children(seconds=120):
Wait for all children to exit.
ParameterssecondsMaximum number of seconds to wait. If None, wait forever.
def test_default_timeout():
Don't timeout by default in tests.
def wsgi_application(environ, start_response):
This is a wsgi application for Zope functional testing.

We use it with wsgi_intercept, which is itself mostly interesting for our webservice (lazr.restful) tests.

API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.