Merge "Remove six again"
This commit is contained in:
commit
1625b38ca0
@ -140,7 +140,7 @@ def encrypt_data(key, data):
|
|||||||
|
|
||||||
# AES algorithm uses block size of 16 bytes = 128 bits, defined in
|
# AES algorithm uses block size of 16 bytes = 128 bits, defined in
|
||||||
# algorithms.AES.block_size. Previously, we manually padded this using
|
# algorithms.AES.block_size. Previously, we manually padded this using
|
||||||
# six.int2byte(padding) * padding. Using ``cryptography``, we will
|
# bytes((padding,)) * padding. Using ``cryptography``, we will
|
||||||
# analogously use hazmat.primitives.padding to pad it to
|
# analogously use hazmat.primitives.padding to pad it to
|
||||||
# the 128-bit block size.
|
# the 128-bit block size.
|
||||||
padder = padding.PKCS7(algorithms.AES.block_size).padder()
|
padder = padding.PKCS7(algorithms.AES.block_size).padder()
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
import base64
|
import base64
|
||||||
import copy
|
import copy
|
||||||
import hashlib
|
import hashlib
|
||||||
|
from http import HTTPStatus
|
||||||
import jwt.utils
|
import jwt.utils
|
||||||
import logging
|
import logging
|
||||||
import ssl
|
import ssl
|
||||||
@ -26,8 +27,6 @@ import webob.dec
|
|||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
import six
|
|
||||||
from six.moves import http_client
|
|
||||||
import testresources
|
import testresources
|
||||||
|
|
||||||
from keystoneauth1 import exceptions as ksa_exceptions
|
from keystoneauth1 import exceptions as ksa_exceptions
|
||||||
@ -282,7 +281,7 @@ class BaseExternalOauth2TokenMiddlewareTest(base.BaseAuthTokenTestCase,
|
|||||||
self.fake_app(expected_env=self.expected_env), self.conf)
|
self.fake_app(expected_env=self.expected_env), self.conf)
|
||||||
|
|
||||||
def call(self, middleware, method='GET', path='/', headers=None,
|
def call(self, middleware, method='GET', path='/', headers=None,
|
||||||
expected_status=http_client.OK,
|
expected_status=HTTPStatus.OK,
|
||||||
expected_body_string=None, **kwargs):
|
expected_body_string=None, **kwargs):
|
||||||
req = webob.Request.blank(path, **kwargs)
|
req = webob.Request.blank(path, **kwargs)
|
||||||
req.method = method
|
req.method = method
|
||||||
@ -293,7 +292,7 @@ class BaseExternalOauth2TokenMiddlewareTest(base.BaseAuthTokenTestCase,
|
|||||||
resp = req.get_response(middleware)
|
resp = req.get_response(middleware)
|
||||||
self.assertEqual(expected_status, resp.status_int)
|
self.assertEqual(expected_status, resp.status_int)
|
||||||
if expected_body_string:
|
if expected_body_string:
|
||||||
self.assertIn(expected_body_string, six.text_type(resp.body))
|
self.assertIn(expected_body_string, str(resp.body))
|
||||||
resp.request = req
|
resp.request = req
|
||||||
return resp
|
return resp
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user