aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-28 15:56:08 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-06-28 15:56:08 +0000
commit0d5e9ebcf731e5c437ab991dd9af3f4cf1cb827d (patch)
tree5b64935de3accd3c4e589efccb5b1bdb0f86936d
parentbbced563ad9ceca5021c65a2e6284861d36db4f8 (diff)
parentda7539acd6a3d7772f8152db09c2f80a344c4ece (diff)
Merge "Cleanup process test cases"
-rw-r--r--yardstick/tests/unit/common/test_process.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/yardstick/tests/unit/common/test_process.py b/yardstick/tests/unit/common/test_process.py
index 1c6dfec27..e0933c6ac 100644
--- a/yardstick/tests/unit/common/test_process.py
+++ b/yardstick/tests/unit/common/test_process.py
@@ -90,10 +90,11 @@ class ExecuteTestCase(unittest.TestCase):
additional_env=self.additional_env)
self.assertEqual(self.stdout, out)
- def test_execute_exception(self):
+ @mock.patch.object(process, 'LOG')
+ def test_execute_exception(self, *args):
self.obj.returncode = self.RET_CODE_WRONG
- self.assertRaises(exceptions.ProcessExecutionError, process.execute,
- self.input_cmd, additional_env=self.additional_env)
+ with self.assertRaises(exceptions.ProcessExecutionError):
+ process.execute(self.input_cmd, additional_env=self.additional_env)
self.obj.communicate.assert_called_once_with(None)
def test_execute_with_extra_code(self):
@@ -107,7 +108,8 @@ class ExecuteTestCase(unittest.TestCase):
additional_env=self.additional_env)
self.assertEqual(self.stdout, out)
- def test_execute_exception_no_check(self):
+ @mock.patch.object(process, 'LOG')
+ def test_execute_exception_no_check(self, *args):
self.obj.returncode = self.RET_CODE_WRONG
out = process.execute(self.input_cmd,
additional_env=self.additional_env,