summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-07-05 07:52:53 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-07-05 07:52:53 +0000
commit0a3f4715bed95b5a8a231fc49b9a4b4de6bd5ca9 (patch)
treea455c4d97927b700c341770533e0ea1a40873e7e
parent638d6d7dce80a11c7e0f9045ccaee5a09ecbe450 (diff)
parent3327680ec27c9bbbb5b7d927c05c8c984ece4f18 (diff)
Merge "Cleanup ScenarioGeneral unit tests"
-rw-r--r--yardstick/tests/unit/benchmark/scenarios/availability/test_scenario_general.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/yardstick/tests/unit/benchmark/scenarios/availability/test_scenario_general.py b/yardstick/tests/unit/benchmark/scenarios/availability/test_scenario_general.py
index cd065c961..dbf3d83b2 100644
--- a/yardstick/tests/unit/benchmark/scenarios/availability/test_scenario_general.py
+++ b/yardstick/tests/unit/benchmark/scenarios/availability/test_scenario_general.py
@@ -13,6 +13,7 @@ import unittest
from yardstick.benchmark.scenarios.availability import scenario_general
from yardstick.common import exceptions as y_exc
+
class ScenarioGeneralTestCase(unittest.TestCase):
@mock.patch.object(scenario_general, 'Director')
@@ -37,19 +38,21 @@ class ScenarioGeneralTestCase(unittest.TestCase):
'index': 2}]
}
}
- self.instance = scenario_general.ScenarioGeneral(self.scenario_cfg, None)
+ self.instance = scenario_general.ScenarioGeneral(self.scenario_cfg,
+ None)
self.instance.setup()
self.instance.director.verify.return_value = True
def test_scenario_general_all_successful(self):
-
ret = {}
self.instance.run(ret)
self.instance.teardown()
self.assertEqual(ret['sla_pass'], 1)
- def test_scenario_general_exception(self):
- self.instance.director.createActionPlayer.side_effect = KeyError('Wrong')
+ @mock.patch.object(scenario_general.LOG, 'exception')
+ def test_scenario_general_exception(self, *args):
+ self.instance.director.createActionPlayer.side_effect = (
+ KeyError('Wrong'))
self.instance.director.data = {}
ret = {}
self.instance.run(ret)