diff options
Diffstat (limited to 'barbicanclient/tests')
-rw-r--r-- | barbicanclient/tests/test_barbican.py | 6 | ||||
-rw-r--r-- | barbicanclient/tests/v1/test_containers.py | 3 | ||||
-rw-r--r-- | barbicanclient/tests/v1/test_secrets.py | 12 |
3 files changed, 6 insertions, 15 deletions
diff --git a/barbicanclient/tests/test_barbican.py b/barbicanclient/tests/test_barbican.py index c34be55..71ce182 100644 --- a/barbicanclient/tests/test_barbican.py +++ b/barbicanclient/tests/test_barbican.py @@ -12,7 +12,7 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. -import six +import io from barbicanclient import barbican as barb from barbicanclient.barbican import Barbican @@ -26,8 +26,8 @@ class WhenTestingBarbicanCLI(test_client.BaseEntityResource): def setUp(self): self._setUp('barbican') - self.captured_stdout = six.StringIO() - self.captured_stderr = six.StringIO() + self.captured_stdout = io.StringIO() + self.captured_stderr = io.StringIO() self.barbican = Barbican( stdout=self.captured_stdout, stderr=self.captured_stderr diff --git a/barbicanclient/tests/v1/test_containers.py b/barbicanclient/tests/v1/test_containers.py index 3cbdd92..291a07e 100644 --- a/barbicanclient/tests/v1/test_containers.py +++ b/barbicanclient/tests/v1/test_containers.py @@ -17,7 +17,6 @@ from unittest import mock from oslo_serialization import jsonutils from oslo_utils import timeutils -import six from barbicanclient import base from barbicanclient.tests import test_client @@ -524,7 +523,7 @@ class WhenTestingContainers(test_client.BaseEntityResource): # Verify that the names of the secret_refs in the containers are None for container in containers_list: - for name in six.iterkeys(container._secret_refs): + for name in container._secret_refs.keys(): self.assertIsNone(name) def test_should_fail_get_invalid_container(self): diff --git a/barbicanclient/tests/v1/test_secrets.py b/barbicanclient/tests/v1/test_secrets.py index dcc2fdf..ef3f61b 100644 --- a/barbicanclient/tests/v1/test_secrets.py +++ b/barbicanclient/tests/v1/test_secrets.py @@ -93,7 +93,7 @@ class WhenTestingSecrets(test_client.BaseEntityResource): self.assertEqual(self.secret.payload, secret_req['payload']) def test_should_store_binary_type_as_octet_stream(self): - """We use six.binary_type as the canonical binary type. + """We use bytes as the canonical binary type. The client should base64 encode the payload before sending the request. @@ -101,8 +101,6 @@ class WhenTestingSecrets(test_client.BaseEntityResource): data = {'secret_ref': self.entity_href} self.responses.post(self.entity_base + '/', json=data) - # This literal will have type(str) in Python 2, but will have - # type(bytes) in Python 3. It is six.binary_type in both cases. binary_payload = b'F\x130\x89f\x8e\xd9\xa1\x0e\x1f\r\xf67uu\x8b' secret = self.manager.create() @@ -119,12 +117,10 @@ class WhenTestingSecrets(test_client.BaseEntityResource): self.assertNotEqual(binary_payload, secret_req['payload']) def test_should_store_text_type_as_text_plain(self): - """We use six.text_type as the canonical text type.""" + """We use unicode string as the canonical text type.""" data = {'secret_ref': self.entity_href} self.responses.post(self.entity_base + '/', json=data) - # This literal will have type(unicode) in Python 2, but will have - # type(str) in Python 3. It is six.text_type in both cases. text_payload = u'time for an ice cold \U0001f37a' secret = self.manager.create() @@ -448,8 +444,6 @@ class WhenTestingSecrets(test_client.BaseEntityResource): self.test_should_delete_from_object(self.entity_id) def test_should_update_from_manager(self, secret_ref=None): - # This literal will have type(unicode) in Python 2, but will have - # type(str) in Python 3. It is six.text_type in both cases. text_payload = u'time for an ice cold \U0001f37a' secret_ref = secret_ref or self.entity_href @@ -479,8 +473,6 @@ class WhenTestingSecrets(test_client.BaseEntityResource): # Verify the secret has the correct ref for testing updates self.assertEqual(secref_ref, secret.secret_ref) - # This literal will have type(unicode) in Python 2, but will have - # type(str) in Python 3. It is six.text_type in both cases. text_payload = u'time for an ice cold \U0001f37a' self.responses.put(self.entity_href, status_code=204) |