diff options
Diffstat (limited to 'tests/unit/benchmark/scenarios/availability/test_serviceha.py')
-rw-r--r-- | tests/unit/benchmark/scenarios/availability/test_serviceha.py | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/unit/benchmark/scenarios/availability/test_serviceha.py b/tests/unit/benchmark/scenarios/availability/test_serviceha.py index 4ae508958..2b630da5a 100644 --- a/tests/unit/benchmark/scenarios/availability/test_serviceha.py +++ b/tests/unit/benchmark/scenarios/availability/test_serviceha.py @@ -18,9 +18,6 @@ import unittest from yardstick.benchmark.scenarios.availability import serviceha -@mock.patch('yardstick.benchmark.scenarios.availability.serviceha.basemonitor') -@mock.patch( - 'yardstick.benchmark.scenarios.availability.serviceha.baseattacker') class ServicehaTestCase(unittest.TestCase): def setUp(self): @@ -51,7 +48,10 @@ class ServicehaTestCase(unittest.TestCase): sla = {"outage_time": 5} self.args = {"options": options, "sla": sla} - def test__serviceha_setup_run_successful(self, mock_attacker, + @mock.patch('yardstick.benchmark.scenarios.availability.serviceha.basemonitor') + @mock.patch( + 'yardstick.benchmark.scenarios.availability.serviceha.baseattacker') + def test__serviceha_setup_run_successful(self, _, mock_monitor): p = serviceha.ServiceHA(self.args, self.ctx) @@ -61,17 +61,19 @@ class ServicehaTestCase(unittest.TestCase): ret = {} p.run(ret) p.teardown() -""" - def test__serviceha_run_sla_error(self, mock_attacker, mock_monitor): - p = serviceha.ServiceHA(self.args, self.ctx) p.setup() self.assertEqual(p.setup_done, True) - result = {} - result["outage_time"] = 10 - mock_monitor.Monitor().get_result.return_value = result +# def test__serviceha_run_sla_error(self, mock_attacker, mock_monitor): +# p = serviceha.ServiceHA(self.args, self.ctx) - ret = {} - self.assertRaises(AssertionError, p.run, ret) -""" +# p.setup() +# self.assertTrue(p.setup_done) +# +# result = {} +# result["outage_time"] = 10 +# mock_monitor.Monitor().get_result.return_value = result + +# ret = {} +# self.assertRaises(AssertionError, p.run, ret) |