summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/availability/test_serviceha.py
diff options
context:
space:
mode:
authorRoss Brattain <ross.b.brattain@intel.com>2018-01-26 21:12:01 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-01-26 21:12:01 +0000
commite6b6f6fca60322f57329d1c93a01c88c3c81b62c (patch)
tree4bceaafce8756246a9e2b46d5ddb791144b3462b /tests/unit/benchmark/scenarios/availability/test_serviceha.py
parent868db57177cdbbebf8d160ca049cdf81fda3a2f4 (diff)
parent298e2e529e815f31c7ae5e0e1154a7fdac92a067 (diff)
Merge changes from topic 'bug/yardstick-864'
* changes: Replace assertEquals with assertEqual Make files pep8 compliant before using assertTrue|False
Diffstat (limited to 'tests/unit/benchmark/scenarios/availability/test_serviceha.py')
-rw-r--r--tests/unit/benchmark/scenarios/availability/test_serviceha.py28
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)