self.addCleanup(self.stubs.UnsetAll)
self.addCleanup(self.stubs.SmartUnsetAll)
self.addCleanup(self.mox.VerifyAll)
+ self.addCleanup(self._common_cleanup)
self.injected = []
self._services = []
# This will be cleaned up by the NestedTempfile fixture
CONF.set_override('lock_path', tempfile.mkdtemp())
- def tearDown(self):
+ def _common_cleanup(self):
"""Runs after each test method to tear down test environment."""
# Stop any timers
# suite
for key in [k for k in self.__dict__.keys() if k[0] != '_']:
del self.__dict__[key]
- super(TestCase, self).tearDown()
def flags(self, **kw):
"""Override CONF variables for a test."""
['0987654321234', '123456789000987'],
}}}
- def setUp(self):
- super(TestHP3PARFCDriver, self).setUp()
-
- def tearDown(self):
- super(TestHP3PARFCDriver, self).tearDown()
-
def setup_driver(self, config=None, mock_conf=None):
self.ctxt = context.get_admin_context()
'target_lun': TARGET_LUN,
'target_portal': '1.1.1.2:1234'}}
- def setUp(self):
- super(TestHP3PARISCSIDriver, self).setUp()
-
- def tearDown(self):
- super(TestHP3PARISCSIDriver, self).tearDown()
-
def setup_driver(self, config=None, mock_conf=None):
self.ctxt = context.get_admin_context()
'iqn.2003-10.com.lefthandnetworks:group01:25366:fakev',
'volume_id': self.volume_id}
- def tearDown(self):
- super(TestHPLeftHandCLIQISCSIDriver, self).tearDown()
-
def default_mock_conf(self):
mock_conf = mock.Mock()
mock.call.getClusterByName('CloudCluster1'),
mock.call.getCluster(1)]
- def setUp(self):
- super(TestHPLeftHandRESTISCSIDriver, self).setUp()
-
- def tearDown(self):
- super(TestHPLeftHandRESTISCSIDriver, self).tearDown()
-
def default_mock_conf(self):
mock_conf = mock.Mock()
self.context.user_id = 'fake'
self.context.project_id = 'fake'
- def tearDown(self):
- super(IBMNASDriverTestCase, self).tearDown()
-
def _set_flag(self, flag, value):
group = self._driver.configuration.config_group
self._driver.configuration.set_override(flag, value, group)
# We start each test case with a completely blank slate.
self._reset_databases()
- def tearDown(self):
-
# We destroy the test data store between each test case,
# and recreate it, which ensures that we have no side-effects
# from the tests
- self._reset_databases()
- super(TestMigrations, self).tearDown()
+ self.addCleanup(self._reset_databases)
def _reset_databases(self):
def execute_cmd(cmd=None):