summaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/rally/test_rally.py
diff options
context:
space:
mode:
Diffstat (limited to 'functest/tests/unit/openstack/rally/test_rally.py')
-rw-r--r--functest/tests/unit/openstack/rally/test_rally.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/functest/tests/unit/openstack/rally/test_rally.py b/functest/tests/unit/openstack/rally/test_rally.py
index 58881f7a4..cbcf46fce 100644
--- a/functest/tests/unit/openstack/rally/test_rally.py
+++ b/functest/tests/unit/openstack/rally/test_rally.py
@@ -108,7 +108,7 @@ class OSRallyTesting(unittest.TestCase):
self.assertEqual(self.rally_base.get_cmd_output(proc),
'line1line2')
- @mock.patch('__builtin__.open', mock.mock_open())
+ @mock.patch('six.moves.builtins.open', mock.mock_open())
@mock.patch('functest.opnfv_tests.openstack.rally.rally.yaml.safe_load',
return_value={'scenario': [
{'scenarios': ['test_scenario'],
@@ -123,7 +123,7 @@ class OSRallyTesting(unittest.TestCase):
self.assertEqual(self.rally_base.excl_scenario(), ['test'])
mock_func.assert_called()
- @mock.patch('__builtin__.open', mock.mock_open())
+ @mock.patch('six.moves.builtins.open', mock.mock_open())
@mock.patch('functest.opnfv_tests.openstack.rally.rally.yaml.safe_load',
return_value={'scenario': [
{'scenarios': ['^os-[^-]+-featT-modeT$'],
@@ -151,12 +151,12 @@ class OSRallyTesting(unittest.TestCase):
['test1', 'test2', 'test3', 'test4'])
mock_func.assert_called()
- @mock.patch('__builtin__.open', side_effect=Exception)
+ @mock.patch('six.moves.builtins.open', side_effect=Exception)
def test_excl_scenario_exception(self, mock_open):
self.assertEqual(self.rally_base.excl_scenario(), [])
mock_open.assert_called()
- @mock.patch('__builtin__.open', mock.mock_open())
+ @mock.patch('six.moves.builtins.open', mock.mock_open())
@mock.patch('functest.opnfv_tests.openstack.rally.rally.yaml.safe_load',
return_value={'functionality': [
{'functions': ['no_migration'], 'tests': ['test']}]})
@@ -169,7 +169,7 @@ class OSRallyTesting(unittest.TestCase):
mock_func.assert_called()
mock_yaml_load.assert_called()
- @mock.patch('__builtin__.open', side_effect=Exception)
+ @mock.patch('six.moves.builtins.open', side_effect=Exception)
def test_excl_func_exception(self, mock_open):
self.assertEqual(self.rally_base.excl_func(), [])
mock_open.assert_called()
@@ -234,7 +234,7 @@ class OSRallyTesting(unittest.TestCase):
text = 'Failed to retrieve task_id, validating task...'
mock_logger_error.assert_any_call(text)
- @mock.patch('__builtin__.open', mock.mock_open())
+ @mock.patch('six.moves.builtins.open', mock.mock_open())
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'
'_prepare_test_list', return_value='test_file_name')
@mock.patch('functest.opnfv_tests.openstack.rally.rally.RallyBase.'