aboutsummaryrefslogtreecommitdiffstats
path: root/functest/tests/unit/utils/test_openstack_utils.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-12-11 13:44:42 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2017-12-12 05:03:45 +0100
commitdf6ee9b1222ebd81fa22ce3499e536abe7bcb05e (patch)
tree2517662ac546431a93f7c1aee1070bf55c7b29f2 /functest/tests/unit/utils/test_openstack_utils.py
parent41a81e7f5ca5d3733e6e5655f5ece7859ce9f49b (diff)
Add python3 for Functest utils
It also fixes test_utils RegexMatch and SubstrMatch. Change-Id: I124aa7d0c4110dcd2f50220aae7ba9b299799e93 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/tests/unit/utils/test_openstack_utils.py')
-rw-r--r--functest/tests/unit/utils/test_openstack_utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/functest/tests/unit/utils/test_openstack_utils.py b/functest/tests/unit/utils/test_openstack_utils.py
index 307cbe37..01085bb7 100644
--- a/functest/tests/unit/utils/test_openstack_utils.py
+++ b/functest/tests/unit/utils/test_openstack_utils.py
@@ -365,7 +365,8 @@ class OSUtilsTesting(unittest.TestCase):
except:
pass
f = 'rc_file'
- with mock.patch('__builtin__.open', mock.mock_open(read_data=msg),
+ with mock.patch('six.moves.builtins.open',
+ mock.mock_open(read_data=msg),
create=True) as m:
m.return_value.__iter__ = lambda self: iter(self.readline, '')
openstack_utils.source_credentials(f)
@@ -1460,7 +1461,7 @@ class OSUtilsTesting(unittest.TestCase):
return_value=True), \
mock.patch('functest.utils.openstack_utils.get_image_id',
return_value=''), \
- mock.patch('__builtin__.open',
+ mock.patch('six.moves.builtins.open',
mock.mock_open(read_data='1')) as m:
self.assertEqual(openstack_utils.
create_glance_image(self.glance_client,