Pulls up _test_atomic_action_timer to TestCase
This method is being duplicated multiple times Change-Id: I696d35f88fc94eccc3c351fc36db0cfb8add773c
This commit is contained in:
parent
e1c67c4b14
commit
604dd822f7
@ -28,11 +28,6 @@ class CeilometerScenarioTestCase(test.TestCase):
|
||||
self.scenario.clients = mock.MagicMock(
|
||||
return_value=fakes.FakeCeilometerClient())
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions_time, name):
|
||||
action_duration = atomic_actions_time.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
def test__list_alarms(self):
|
||||
alarm1_id = "fake_alarm1_id"
|
||||
alarm2_id = "fake_alarm2_id"
|
||||
|
@ -41,11 +41,6 @@ class CinderScenarioTestCase(test.TestCase):
|
||||
self.useFixture(mockpatch.Patch('time.sleep'))
|
||||
self.scenario = utils.CinderScenario()
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(CINDER_UTILS + '.CinderScenario.clients')
|
||||
def test__list_volumes(self, mock_clients):
|
||||
volumes_list = mock.Mock()
|
||||
|
@ -29,11 +29,6 @@ class DesignateScenarioTestCase(test.TestCase):
|
||||
super(DesignateScenarioTestCase, self).setUp()
|
||||
self.domain = mock.Mock()
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions_time, name):
|
||||
action_duration = atomic_actions_time.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(DESIGNATE_UTILS + 'DesignateScenario._generate_random_name')
|
||||
@mock.patch(DESIGNATE_UTILS + 'DesignateScenario.clients')
|
||||
def test_create_domain(self, mock_clients, mock_random_name):
|
||||
|
@ -53,11 +53,6 @@ class GlanceScenarioTestCase(test.TestCase):
|
||||
butils.get_from_manager(),
|
||||
image_manager.create('fails', 'url', 'cf', 'df'))
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(GLANCE_UTILS + '.GlanceScenario.clients')
|
||||
def test_list_images(self, mock_clients):
|
||||
images_list = []
|
||||
|
@ -42,11 +42,6 @@ class HeatScenarioTestCase(test.TestCase):
|
||||
self.useFixture(mockpatch.Patch('time.sleep'))
|
||||
self.scenario = utils.HeatScenario()
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(HEAT_UTILS + '.HeatScenario.clients')
|
||||
def test_list_stacks(self, mock_clients):
|
||||
stacks_list = []
|
||||
|
@ -51,11 +51,6 @@ class KeystoneUtilsTestCase(test.TestCase):
|
||||
|
||||
class KeystoneScenarioTestCase(test.TestCase):
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(UTILS + "uuid.uuid4", return_value="pwd")
|
||||
@mock.patch(UTILS + "KeystoneScenario._generate_random_name",
|
||||
return_value="abc")
|
||||
|
@ -29,11 +29,6 @@ class NeutronScenarioTestCase(test.TestCase):
|
||||
super(NeutronScenarioTestCase, self).setUp()
|
||||
self.network = mock.Mock()
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions_time, name):
|
||||
action_duration = atomic_actions_time.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(NEUTRON_UTILS + 'NeutronScenario._generate_random_name')
|
||||
@mock.patch(NEUTRON_UTILS + 'NeutronScenario.clients')
|
||||
def test_create_network(self, mock_clients, mock_random_name):
|
||||
|
@ -23,6 +23,7 @@ from rally import exceptions as rally_exceptions
|
||||
from tests.unit import fakes
|
||||
from tests.unit import test
|
||||
|
||||
|
||||
BM_UTILS = 'rally.benchmark.utils'
|
||||
NOVA_UTILS = "rally.benchmark.scenarios.nova.utils"
|
||||
CONF = cfg.CONF
|
||||
@ -49,11 +50,6 @@ class NovaScenarioTestCase(test.TestCase):
|
||||
self.gfm = self.get_fm.mock
|
||||
self.useFixture(mockpatch.Patch('time.sleep'))
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
def test_failed_server_status(self):
|
||||
self.get_fm.cleanUp()
|
||||
server_manager = fakes.FakeFailedServerManager()
|
||||
|
@ -26,11 +26,6 @@ class QuotasScenarioTestCase(test.TestCase):
|
||||
def setUp(self):
|
||||
super(QuotasScenarioTestCase, self).setUp()
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions_time, name):
|
||||
action_duration = atomic_actions_time.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
def test__update_quotas(self):
|
||||
tenant_id = 'fake_tenant'
|
||||
quotas = {
|
||||
|
@ -34,11 +34,6 @@ class SaharaUtilsTestCase(test.TestCase):
|
||||
CONF.set_override("cluster_check_interval", 0, "benchmark")
|
||||
CONF.set_override("job_check_interval", 0, "benchmark")
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(SAHARA_UTILS + '.SaharaScenario.clients')
|
||||
def test_list_node_group_templates(self, mock_clients):
|
||||
ngts = []
|
||||
|
@ -23,11 +23,6 @@ UTILS = "rally.benchmark.scenarios.zaqar.utils."
|
||||
|
||||
class ZaqarScenarioTestCase(test.TestCase):
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
@mock.patch(UTILS + "ZaqarScenario._generate_random_name",
|
||||
return_value="kitkat")
|
||||
def test_queue_create(self, mock_gen_name):
|
||||
|
@ -37,6 +37,11 @@ class TestCase(base.BaseTestCase):
|
||||
super(TestCase, self).setUp()
|
||||
self.addCleanup(mock.patch.stopall)
|
||||
|
||||
def _test_atomic_action_timer(self, atomic_actions, name):
|
||||
action_duration = atomic_actions.get(name)
|
||||
self.assertIsNotNone(action_duration)
|
||||
self.assertIsInstance(action_duration, float)
|
||||
|
||||
|
||||
class DBTestCase(TestCase):
|
||||
"""Base class for tests which use DB."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user