Fake Drivers

Fake Drivers

TODO: document general info about fakes

When the real thing isn’t available and you have some development to do these fake implementations of various drivers let you get on with your day.

The cinder.tests.unit.test_service.FakeManager Class

class FakeManager(host=None, db_driver=None, service_name=None, cluster=None)

Bases: cinder.manager.Manager

Fake manager for tests.

test_method()

The cinder.tests.unit.api.fakes Module

class Context

Bases: object

class FakeAuthDatabase

Bases: object

static auth_token_create(context, token)
static auth_token_destroy(context, token_id)
static auth_token_get(context, token_hash)
data = {}
class FakeRateLimiter(application)

Bases: object

class FakeRequestContext(*args, **kwargs)

Bases: cinder.context.RequestContext

class FakeRouter(ext_mgr=None)

Bases: oslo_service.wsgi.Router

class FakeToken(**kwargs)

Bases: object

id_count = 0
class HTTPRequest(environ, charset=None, unicode_errors=None, decode_param_names=None, **kw)

Bases: webob.request.Request

classmethod blank(*args, **kwargs)

Create a blank request environ (and Request wrapper) with the given path (path should be urlencoded), and any keys from environ.

The path will become path_info, with any query string split off and used.

All necessary keys will be added to the environ, but the values you pass in will take precedence. If you pass in base_url then wsgi.url_scheme, HTTP_HOST, and SCRIPT_NAME will be filled in from that value.

Any extra keyword will be passed to __init__.

class TestRouter(controller)

Bases: oslo_service.wsgi.Router

get_fake_uuid(token=0)
wsgi_app(inner_app_v2=None, fake_auth=True, fake_auth_context=None, use_no_auth=False, ext_mgr=None, inner_app_v3=None)
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.