diff options
author | Ross Brattain <ross.b.brattain@intel.com> | 2018-04-17 17:07:43 -0700 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2018-04-17 17:08:51 -0700 |
commit | be5e495a1cb7ab97b9202900defaf00dbd773054 (patch) | |
tree | 631390998614b7954eaf29b53e6d67e5de7427ec | |
parent | f3f75ea39678b6da24e5ed6a61f77586f71d0128 (diff) |
fix unittest test_deploy_try_retrieve_context_does_not_exist
unittest is failing due to mock being called multiple times.
I assume this is due to parallelization of tests in Jenkins somehow
======================================================================
FAIL: test_deploy_try_retrieve_context_does_not_exist (benchmark.contexts.test_heat.HeatContextTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/mock/mock.py", line 1305, in patched
return func(*args, **keywargs)
File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/yardstick/tests/unit/benchmark/contexts/test_heat.py", line 309, in test_deploy_try_retrieve_context_does_not_exist
mock_path_exists.assert_called_once_with(key_filename)
File "/home/jenkins/opnfv/slave_root/workspace/yardstick-verify-master/.tox/py3/lib/python3.5/site-packages/mock/mock.py", line 947, in assert_called_once_with
raise AssertionError(msg)
AssertionError: Expected 'exists' to be called once. Called 3 times.
----------------------------------------------------------------------
Change-Id: I696c63ef9f7943b841e2d3d533c92f18aa7044da
Signed-off-by: Ross Brattain <ross.b.brattain@intel.com>
-rw-r--r-- | yardstick/tests/unit/benchmark/contexts/test_heat.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/yardstick/tests/unit/benchmark/contexts/test_heat.py b/yardstick/tests/unit/benchmark/contexts/test_heat.py index 625f97bf4..a40adf5ae 100644 --- a/yardstick/tests/unit/benchmark/contexts/test_heat.py +++ b/yardstick/tests/unit/benchmark/contexts/test_heat.py @@ -306,7 +306,7 @@ class HeatContextTestCase(unittest.TestCase): 'yardstick/resources/files/yardstick_key-', self.test_context._name]) mock_genkeys.assert_called_once_with(key_filename) - mock_path_exists.assert_called_once_with(key_filename) + mock_path_exists.assert_any_call(key_filename) @mock.patch.object(heat, 'HeatTemplate', return_value='heat_template') @mock.patch.object(heat.HeatContext, '_add_resources_to_template') |