summaryrefslogtreecommitdiff
path: root/openstackclient/tests/functional
diff options
context:
space:
mode:
Diffstat (limited to 'openstackclient/tests/functional')
-rw-r--r--openstackclient/tests/functional/common/test_help.py2
-rw-r--r--openstackclient/tests/functional/compute/v2/test_agent.py4
-rw-r--r--openstackclient/tests/functional/compute/v2/test_keypair.py4
-rw-r--r--openstackclient/tests/functional/object/v1/test_object.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/openstackclient/tests/functional/common/test_help.py b/openstackclient/tests/functional/common/test_help.py
index 7f274099..88f7ddbd 100644
--- a/openstackclient/tests/functional/common/test_help.py
+++ b/openstackclient/tests/functional/common/test_help.py
@@ -80,7 +80,7 @@ class HelpTests(base.TestCase):
"""Check help commands without auth info."""
# Pop all auth info. os.environ will be changed in loop, so do not
# replace os.environ.keys() to os.environ
- for key in os.environ.keys():
+ for key in list(os.environ):
if key.startswith('OS_'):
self.useFixture(fixtures.EnvironmentVariable(key, None))
diff --git a/openstackclient/tests/functional/compute/v2/test_agent.py b/openstackclient/tests/functional/compute/v2/test_agent.py
index 1a112e82..25d8c868 100644
--- a/openstackclient/tests/functional/compute/v2/test_agent.py
+++ b/openstackclient/tests/functional/compute/v2/test_agent.py
@@ -21,10 +21,10 @@ class ComputeAgentTests(base.TestCase):
# Generate two different md5hash
MD5HASH1 = hashlib.md5()
- MD5HASH1.update('agent_1')
+ MD5HASH1.update('agent_1'.encode('utf-8'))
MD5HASH1 = MD5HASH1.hexdigest()
MD5HASH2 = hashlib.md5()
- MD5HASH2.update('agent_2')
+ MD5HASH2.update('agent_2'.encode('utf-8'))
MD5HASH2 = MD5HASH2.hexdigest()
def test_compute_agent_delete(self):
diff --git a/openstackclient/tests/functional/compute/v2/test_keypair.py b/openstackclient/tests/functional/compute/v2/test_keypair.py
index 9a88e66f..42f334a4 100644
--- a/openstackclient/tests/functional/compute/v2/test_keypair.py
+++ b/openstackclient/tests/functional/compute/v2/test_keypair.py
@@ -88,7 +88,7 @@ class KeypairTests(KeypairBase):
1) Create keypair with given public key
2) Delete keypair
"""
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(mode='w+') as f:
f.write(self.PUBLIC_KEY)
f.flush()
@@ -108,7 +108,7 @@ class KeypairTests(KeypairBase):
1) Create keypair with private key file
2) Delete keypair
"""
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(mode='w+') as f:
cmd_output = json.loads(self.openstack(
'keypair create -f json --private-key %s tmpkey' % f.name,
))
diff --git a/openstackclient/tests/functional/object/v1/test_object.py b/openstackclient/tests/functional/object/v1/test_object.py
index 226ef8ad..b3f23e52 100644
--- a/openstackclient/tests/functional/object/v1/test_object.py
+++ b/openstackclient/tests/functional/object/v1/test_object.py
@@ -33,7 +33,7 @@ class ObjectTests(common.ObjectStoreTests):
self.skipTest("No object-store service present")
def test_object(self):
- with tempfile.NamedTemporaryFile() as f:
+ with tempfile.NamedTemporaryFile(mode='w+') as f:
f.write('test content')
f.flush()
self._test_object(f.name)