[Part6] Remove six
We don't need this in a Python 3-only world. Remove six in follows: 1. zaqar/tests/unit/transport/wsgi/v1/test_home.py 2. zaqar/tests/unit/transport/wsgi/v1/test_messages.py 3. zaqar/tests/unit/transport/wsgi/v1/test_pools.py 4. zaqar/tests/unit/transport/wsgi/v1/test_queue_lifecycle.py 5. zaqar/tests/unit/transport/wsgi/v1_1/test_home.py 6. zaqar/tests/unit/transport/wsgi/v1_1/test_messages.py 7. zaqar/tests/unit/transport/wsgi/v1_1/test_queue_lifecycle.py 8. zaqar/tests/unit/transport/wsgi/v2_0/test_messages.py 9. zaqar/tests/unit/transport/wsgi/v2_0/test_pools_new.py 10. zaqar/tests/unit/transport/wsgi/v2_0/test_queue_lifecycle.py 11. zaqar/tests/unit/transport/wsgi/v2_0/test_topic_lifecycle.py Change-Id: I65f58d5e6440ec7a65d6386d1139783a84bba883
This commit is contained in:
parent
20fabeb0b5
commit
074f62ac97
|
@ -14,7 +14,7 @@
|
|||
|
||||
import falcon
|
||||
from oslo_serialization import jsonutils
|
||||
import six.moves.urllib.parse as urlparse
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from zaqar.tests.unit.transport.wsgi import base
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import mock
|
|||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
from testtools import matchers
|
||||
|
||||
from zaqar import tests as testing
|
||||
|
@ -87,7 +86,7 @@ class TestMessagesMongoDB(base.V1Base):
|
|||
msg_ids = self._get_msg_ids(self.srmock.headers_dict)
|
||||
self.assertEqual(len(sample_messages), len(msg_ids))
|
||||
|
||||
expected_resources = [six.text_type(self.messages_path + '/' + id)
|
||||
expected_resources = [str(self.messages_path + '/' + id)
|
||||
for id in msg_ids]
|
||||
self.assertEqual(expected_resources, result_doc['resources'])
|
||||
|
||||
|
@ -189,9 +188,6 @@ class TestMessagesMongoDB(base.V1Base):
|
|||
|
||||
path = self.url_prefix + u'/queues/non-ascii-n\u0153me/messages'
|
||||
|
||||
if six.PY2:
|
||||
path = path.encode('utf-8')
|
||||
|
||||
self._post_messages(path)
|
||||
self.assertEqual(falcon.HTTP_400, self.srmock.status)
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ def pool(test, name, weight, uri, options={}):
|
|||
|
||||
:param test: Must expose simulate_* methods
|
||||
:param name: Name for this pool
|
||||
:type name: six.text_type
|
||||
:type name: str
|
||||
:type weight: int
|
||||
:type uri: six.text_type
|
||||
:type uri: str
|
||||
:type options: dict
|
||||
:returns: (name, weight, uri, options)
|
||||
:rtype: see above
|
||||
|
@ -61,7 +61,7 @@ def pools(test, count, uri):
|
|||
:param count: Number of pools to create
|
||||
:type count: int
|
||||
:returns: (paths, weights, uris, options)
|
||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||
:rtype: ([str], [int], [str], [dict])
|
||||
"""
|
||||
mongo_url = uri
|
||||
base = test.url_prefix + '/pools/'
|
||||
|
|
|
@ -16,7 +16,6 @@ import ddt
|
|||
import falcon
|
||||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
import six
|
||||
|
||||
from zaqar.storage import errors as storage_errors
|
||||
from zaqar import tests as testing
|
||||
|
@ -147,9 +146,6 @@ class TestQueueLifecycleMongoDB(base.V1Base):
|
|||
for uri, enc in test_params:
|
||||
uri = self.url_prefix + uri
|
||||
|
||||
if six.PY2:
|
||||
uri = uri.encode(enc)
|
||||
|
||||
self.simulate_put(uri)
|
||||
self.assertEqual(falcon.HTTP_400, self.srmock.status)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
import falcon
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
import six.moves.urllib.parse as urlparse
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from zaqar.tests.unit.transport.wsgi import base
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import falcon
|
|||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
from testtools import matchers
|
||||
|
||||
from zaqar import tests as testing
|
||||
|
@ -103,7 +102,7 @@ class TestMessagesMongoDB(base.V1_1Base):
|
|||
msg_ids = self._get_msg_ids(self.srmock.headers_dict)
|
||||
self.assertEqual(len(sample_messages), len(msg_ids))
|
||||
|
||||
expected_resources = [six.text_type(self.messages_path + '/' + id)
|
||||
expected_resources = [str(self.messages_path + '/' + id)
|
||||
for id in msg_ids]
|
||||
self.assertEqual(expected_resources, result_doc['resources'])
|
||||
|
||||
|
@ -231,9 +230,6 @@ class TestMessagesMongoDB(base.V1_1Base):
|
|||
|
||||
path = self.url_prefix + u'/queues/non-ascii-n\u0153me/messages'
|
||||
|
||||
if six.PY2:
|
||||
path = path.encode('utf-8')
|
||||
|
||||
self._post_messages(path)
|
||||
self.assertEqual(falcon.HTTP_400, self.srmock.status)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import falcon
|
|||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
|
||||
from zaqar.storage import errors as storage_errors
|
||||
from zaqar import tests as testing
|
||||
|
@ -140,9 +139,6 @@ class TestQueueLifecycleMongoDB(base.V1_1Base):
|
|||
for uri, enc in test_params:
|
||||
uri = self.url_prefix + uri
|
||||
|
||||
if six.PY2:
|
||||
uri = uri.encode(enc)
|
||||
|
||||
self.simulate_put(uri, headers=self.headers)
|
||||
self.assertEqual(falcon.HTTP_400, self.srmock.status)
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ def flavor(test, name, pool_list):
|
|||
|
||||
:param test: Must expose simulate_* methods
|
||||
:param name: Name for this flavor
|
||||
:type name: six.text_type
|
||||
:type pool: six.text_type
|
||||
:type name: str
|
||||
:type pool: str
|
||||
:returns: (name, uri, capabilities)
|
||||
:rtype: see above
|
||||
|
||||
|
@ -60,7 +60,7 @@ def flavors(test, count):
|
|||
:param count: Number of pools to create
|
||||
:type count: int
|
||||
:returns: (paths, pool_list capabilities)
|
||||
:rtype: ([six.text_type], [six.text_type], [dict])
|
||||
:rtype: ([str], [str], [dict])
|
||||
|
||||
"""
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
import falcon
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
import six.moves.urllib.parse as urlparse
|
||||
from urllib import parse as urlparse
|
||||
|
||||
from zaqar.tests.unit.transport.wsgi import base
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ import mock
|
|||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import timeutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
from testtools import matchers
|
||||
|
||||
from zaqar import tests as testing
|
||||
|
@ -117,7 +116,7 @@ class TestMessagesMongoDB(base.V2Base):
|
|||
msg_ids = self._get_msg_ids(self.srmock.headers_dict)
|
||||
self.assertEqual(len(sample_messages), len(msg_ids))
|
||||
|
||||
expected_resources = [six.text_type(self.messages_path + '/' + id)
|
||||
expected_resources = [str(self.messages_path + '/' + id)
|
||||
for id in msg_ids]
|
||||
self.assertEqual(expected_resources, result_doc['resources'])
|
||||
|
||||
|
@ -261,9 +260,6 @@ class TestMessagesMongoDB(base.V2Base):
|
|||
|
||||
path = self.url_prefix + u'/queues/non-ascii-n\u0153me/messages'
|
||||
|
||||
if six.PY2:
|
||||
path = path.encode('utf-8')
|
||||
|
||||
self._post_messages(path)
|
||||
self.assertEqual(falcon.HTTP_400, self.srmock.status)
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@ def pool(test, name, weight, uri, flavor=None, options={}):
|
|||
|
||||
:param test: Must expose simulate_* methods
|
||||
:param name: Name for this pool
|
||||
:type name: six.text_type
|
||||
:type name: str
|
||||
:type weight: int
|
||||
:type uri: six.text_type
|
||||
:type uri: str
|
||||
:type options: dict
|
||||
:returns: (name, weight, uri, options)
|
||||
:rtype: see above
|
||||
|
@ -62,7 +62,7 @@ def pools(test, count, uri, flavor):
|
|||
:param count: Number of pools to create
|
||||
:type count: int
|
||||
:returns: (paths, weights, uris, options)
|
||||
:rtype: ([six.text_type], [int], [six.text_type], [dict])
|
||||
:rtype: ([str], [int], [str], [dict])
|
||||
"""
|
||||
mongo_url = uri
|
||||
base = test.url_prefix + '/pools/'
|
||||
|
|
|
@ -18,7 +18,6 @@ import falcon
|
|||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
|
||||
from zaqar.storage import errors as storage_errors
|
||||
from zaqar import tests as testing
|
||||
|
@ -215,9 +214,6 @@ class TestQueueLifecycleMongoDB(base.V2Base):
|
|||
for uri, enc in test_params:
|
||||
uri = self.url_prefix + uri
|
||||
|
||||
if six.PY2:
|
||||
uri = uri.encode(enc)
|
||||
|
||||
self.simulate_put(uri, headers=self.headers)
|
||||
self.assertEqual(falcon.HTTP_400, self.srmock.status)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ import falcon
|
|||
import mock
|
||||
from oslo_serialization import jsonutils
|
||||
from oslo_utils import uuidutils
|
||||
import six
|
||||
|
||||
from zaqar.storage import errors as storage_errors
|
||||
from zaqar import tests as testing
|
||||
|
@ -207,9 +206,6 @@ class TestTopicLifecycleMongoDB(base.V2Base):
|
|||
for uri, enc in test_params:
|
||||
uri = self.url_prefix + uri
|
||||
|
||||
if six.PY2:
|
||||
uri = uri.encode(enc)
|
||||
|
||||
self.simulate_put(uri, headers=self.headers)
|
||||
self.assertEqual(falcon.HTTP_400, self.srmock.status)
|
||||
|
||||
|
|
Loading…
Reference in New Issue