summaryrefslogtreecommitdiffstats
path: root/tests/unit/benchmark/scenarios/availability/test_serviceha.py
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2018-01-10 10:48:29 +0000
committerEmma Foley <emma.l.foley@intel.com>2018-01-25 20:03:46 +0000
commit44ee5e004f3af5dcdbbc1d172faba91b8419b6d6 (patch)
treef81cd5a5af0f267f981339d9ac0d4eba5c666264 /tests/unit/benchmark/scenarios/availability/test_serviceha.py
parente67082ecf9c89eeebbdf2c87b0a90e3edef2eabd (diff)
Make files pep8 compliant before using assertTrue|False
JIRA: YARDSTICK-903 Signed-off-by: Emma Foley <emma.l.foley@intel.com> Change-Id: Id7912b5ddee36e7366bcfa824379853efd0a89f1
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)