summaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/openstack/tempest/test_tempest.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-06-14 20:51:41 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-06-14 20:51:41 +0200
commit09d6e6feef33fa47bca440a096894b851b1ebca5 (patch)
treee3a528dc0c5509cd1ca4071b165399ca3f344817 /functest/tests/unit/openstack/tempest/test_tempest.py
parent1ef7fd44523182a8b8ddcc97433fff55ba17fce8 (diff)
Add py3 support in tempest and rally
Change-Id: I009d38a0db409ab4ec641cba9173ab2386d0ce2a Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/openstack/tempest/test_tempest.py')
-rw-r--r--functest/tests/unit/openstack/tempest/test_tempest.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/functest/tests/unit/openstack/tempest/test_tempest.py b/functest/tests/unit/openstack/tempest/test_tempest.py
index 25737d123..9116100cd 100644
--- a/functest/tests/unit/openstack/tempest/test_tempest.py
+++ b/functest/tests/unit/openstack/tempest/test_tempest.py
@@ -114,7 +114,8 @@ class OSTempestTesting(unittest.TestCase):
@mock.patch("os.remove")
@mock.patch("os.path.exists", return_value=True)
def test_apply_missing_blacklist(self, *args):
- with mock.patch('__builtin__.open', mock.mock_open()) as mock_open, \
+ with mock.patch('six.moves.builtins.open',
+ mock.mock_open()) as mock_open, \
mock.patch.object(self.tempestcommon, 'read_file',
return_value=['test1', 'test2']):
conf_utils.TEMPEST_BLACKLIST = Exception
@@ -136,7 +137,8 @@ class OSTempestTesting(unittest.TestCase):
item_dict = {'scenarios': ['deploy_scenario'],
'installers': ['installer_type'],
'tests': ['test2']}
- with mock.patch('__builtin__.open', mock.mock_open()) as mock_open, \
+ with mock.patch('six.moves.builtins.open',
+ mock.mock_open()) as mock_open, \
mock.patch.object(self.tempestcommon, 'read_file',
return_value=['test1', 'test2']), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
@@ -154,8 +156,9 @@ class OSTempestTesting(unittest.TestCase):
@mock.patch('functest.opnfv_tests.openstack.tempest.tempest.LOGGER.info')
def test_run_verifier_tests_default(self, mock_logger_info):
- with mock.patch('__builtin__.open', mock.mock_open()), \
- mock.patch('__builtin__.iter', return_value=[r'\} tempest\.']), \
+ with mock.patch('six.moves.builtins.open', mock.mock_open()), \
+ mock.patch('six.moves.builtins.iter',
+ return_value=[r'\} tempest\.']), \
mock.patch('functest.opnfv_tests.openstack.tempest.tempest.'
'subprocess.Popen'):
conf_utils.TEMPEST_LIST = 'test_tempest_list'