aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/availability/test_serviceha.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/benchmark/scenarios/availability/test_serviceha.py')
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_serviceha.py32
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/unit/benchmark/scenarios/availability/test_serviceha.py b/tests/unit/benchmark/scenarios/availability/test_serviceha.py
index 4ae508958..97d534894 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,27 +48,32 @@ 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)
p.setup()
- self.assertEqual(p.setup_done, True)
+ self.assertTrue(p.setup_done)
mock_monitor.MonitorMgr().verify_SLA.return_value = True
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)
+ self.assertTrue(p.setup_done)
- 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)