summaryrefslogtreecommitdiff
path: root/glanceclient/tests/unit/v1/test_images.py
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2020-07-16 21:25:14 +0000
committerGerrit Code Review <review@openstack.org>2020-07-16 21:25:14 +0000
commitdca62b4de1a366a869ff9feb88dbb830e1055b7b (patch)
tree25ce7069e62ffc23ff73ccc34406db6ad9203f17 /glanceclient/tests/unit/v1/test_images.py
parent3cd06f763fdb2c2ee233cb8167aadb5f29000d97 (diff)
parent928935e5c0b8b43827fdf08b212d59d92b660924 (diff)
downloadpython-glanceclient-dca62b4de1a366a869ff9feb88dbb830e1055b7b.tar.gz
Merge "Do not use the six library in the tests."
Diffstat (limited to 'glanceclient/tests/unit/v1/test_images.py')
-rw-r--r--glanceclient/tests/unit/v1/test_images.py14
1 files changed, 5 insertions, 9 deletions
diff --git a/glanceclient/tests/unit/v1/test_images.py b/glanceclient/tests/unit/v1/test_images.py
index 1f43b83..1af7412 100644
--- a/glanceclient/tests/unit/v1/test_images.py
+++ b/glanceclient/tests/unit/v1/test_images.py
@@ -14,11 +14,10 @@
# under the License.
import errno
+import io
import json
import testtools
-
-import six
-from six.moves.urllib import parse
+from urllib import parse
from glanceclient.tests import utils
from glanceclient.v1 import client
@@ -634,7 +633,7 @@ class ImageManagerTest(testtools.TestCase):
self.assertEqual({'a': 'b', 'c': 'd'}, image.properties)
def test_create_with_data(self):
- image_data = six.StringIO('XXX')
+ image_data = io.StringIO('XXX')
self.mgr.create(data=image_data)
expect_headers = {'x-image-meta-size': '3'}
expect = [('POST', '/v1/images', expect_headers, image_data)]
@@ -711,7 +710,7 @@ class ImageManagerTest(testtools.TestCase):
self.assertEqual(10, image.min_disk)
def test_update_with_data(self):
- image_data = six.StringIO('XXX')
+ image_data = io.StringIO('XXX')
self.mgr.update('1', data=image_data)
expect_headers = {'x-image-meta-size': '3',
'x-glance-registry-purge-props': 'false'}
@@ -744,10 +743,7 @@ class ImageManagerTest(testtools.TestCase):
def test_image_meta_from_headers_encoding(self):
value = u"ni\xf1o"
- if six.PY2:
- fields = {"x-image-meta-name": "ni\xc3\xb1o"}
- else:
- fields = {"x-image-meta-name": value}
+ fields = {"x-image-meta-name": value}
headers = self.mgr._image_meta_from_headers(fields)
self.assertEqual(value, headers["name"])