Base classes for our unit tests.
Allows overriding of CONF for use of fakes, and some black magic for inline callbacks.
ModelsObjectComparatorMixin
¶Bases: object
RPCAPITestCase
(*args, **kwargs)¶Bases: cinder.test.TestCase
, cinder.test.ModelsObjectComparatorMixin
setUp
()¶TestCase
(*args, **kwargs)¶Bases: testtools.testcase.TestCase
Test case base class for all unit tests.
MOCK_TOOZ
= True¶MOCK_WORKER
= True¶POLICY_PATH
= 'cinder/tests/unit/policy.json'¶RESOURCE_FILTER_PATH
= 'etc/cinder/resource_filters.json'¶assertFalse
(x, *args, **kwargs)¶Assert that value is False.
assertTrue
(x, *args, **kwargs)¶Assert that value is True.
assert_notify_called
(mock_notify, calls)¶flags
(**kw)¶Override CONF variables for a test.
mock_object
(obj, attr_name, *args, **kwargs)¶Use python mock to mock an object attribute
Mocks the specified objects attribute with the given value. Automatically performs ‘addCleanup’ for the mock.
override_config
(name, override, group=None)¶Cleanly override CONF variables.
patch
(path, *args, **kwargs)¶Use python mock to mock a path with automatic cleanup.
setUp
()¶Run before each test method to initialize test environment.
start_service
(name, host=None, **kwargs)¶TestingException
¶Bases: exceptions.Exception
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.