summaryrefslogtreecommitdiff
path: root/functionaltests/client/v1/functional/test_containers.py
diff options
context:
space:
mode:
authorTakashi Kajinami <tkajinam@redhat.com>2020-04-20 17:48:17 +0900
committerDouglas Mendizábal <dmendiza@redhat.com>2020-06-08 15:40:22 -0500
commit6420da336083d936da9a4563149b08d785d70c84 (patch)
tree9cf7c2ce2cff5e7352d7b35a1dcee3bf675534e4 /functionaltests/client/v1/functional/test_containers.py
parente5fdd10f04488d6f6e252a63c57bf2be92a06c8f (diff)
downloadpython-barbicanclient-6420da336083d936da9a4563149b08d785d70c84.tar.gz
Fix gate job failures and py3 compatibility
- Fix incorrect type handling of secret payload in py3 (it should be bytes instead of str by default) - Fix py3 compatibility of test codes - Update expiration date so that resources are created with valid expiration. Change-Id: I4935f601f87e9c49499da1034a320eee2e655b4d
Diffstat (limited to 'functionaltests/client/v1/functional/test_containers.py')
-rw-r--r--functionaltests/client/v1/functional/test_containers.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/functionaltests/client/v1/functional/test_containers.py b/functionaltests/client/v1/functional/test_containers.py
index 64b9cdc..bdcd5a3 100644
--- a/functionaltests/client/v1/functional/test_containers.py
+++ b/functionaltests/client/v1/functional/test_containers.py
@@ -22,11 +22,11 @@ from barbicanclient import exceptions
create_secret_defaults_data = {
"name": "AES key",
- "expiration": "2020-02-28T19:14:44.180394",
+ "expiration": "2030-02-28T19:14:44.180394",
"algorithm": "aes",
"bit_length": 256,
"mode": "cbc",
- "payload": "gF6+lLoF3ohA9aPRpt+6bQ==",
+ "payload": b"gF6+lLoF3ohA9aPRpt+6bQ==",
"payload_content_type": "application/octet-stream",
"payload_content_encoding": "base64",
}
@@ -48,7 +48,7 @@ create_container_empty_data = {
accepted_str_values = {
'alphanumeric': ['a2j3j6ll9'],
'punctuation': ['~!@#$%^&*()_+`-={}[]|:;<>,.?'],
- 'len_255': [str(bytearray().zfill(255))],
+ 'len_255': ['a' * 255],
'uuid': ['54262d9d-4bc7-4821-8df0-dc2ca8e112bb'],
'empty': ['']
}
@@ -139,7 +139,7 @@ class GenericContainersTestCase(BaseContainersTestCase):
e = self.assertRaises(ValueError, self.barbicanclient.containers.get,
url)
- self.assertEqual('Container incorrectly specified.', e.message)
+ self.assertEqual('Container incorrectly specified.', str(e))
@testcase.attr('negative')
def test_get_non_existent_container_valid_uuid(self):
@@ -171,7 +171,7 @@ class GenericContainersTestCase(BaseContainersTestCase):
e = self.assertRaises(ValueError, self.barbicanclient.containers.get,
url)
- self.assertEqual('Container incorrectly specified.', e.message)
+ self.assertEqual('Container incorrectly specified.', str(e))
@testcase.attr('negative')
def test_delete_non_existent_container_valid_uuid(self):
@@ -296,7 +296,7 @@ class RSAContainersTestCase(BaseContainersTestCase):
self.barbicanclient.containers.create_rsa,
**incorrect_names_rsa_container)
- self.assertIn('got an unexpected keyword argument', e.message)
+ self.assertIn('got an unexpected keyword argument', str(e))
@testcase.attr('negative')
def test_create_rsa_no_public_key(self):