summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-04-24 00:26:47 +0000
committerGerrit Code Review <review@openstack.org>2014-04-24 00:26:47 +0000
commitb9bd897639e742387ca901d0bd154363accdd7a4 (patch)
treeb1683f141b2ae1ae70d855aed1720bc7802c40ea
parentfc6670841863723ac0c17424705cb915adcd1a54 (diff)
parent1353f2412b6de71d519bda6cd98513b082978281 (diff)
downloadpython-swiftclient-b9bd897639e742387ca901d0bd154363accdd7a4.tar.gz
Merge "Fix up StringIO use in tests for py3"
-rw-r--r--tests/test_swiftclient.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index 2a49114..4e83a2d 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -24,7 +24,6 @@ except ImportError:
import six
import socket
import types
-import StringIO
import testtools
import warnings
from six.moves.urllib.parse import urlparse
@@ -681,7 +680,7 @@ class TestPutObject(MockHttpTest):
conn[1]._request = resp._fake_request
astring = 'asdf'
astring_len = len(astring)
- mock_file = StringIO.StringIO(astring)
+ mock_file = six.StringIO(astring)
c.put_object(url='http://www.test.com', http_conn=conn,
contents=mock_file, content_length=astring_len)
@@ -690,7 +689,7 @@ class TestPutObject(MockHttpTest):
self.assertEqual(astring_len,
len(resp.requests_params['data'].read()))
- mock_file = StringIO.StringIO(astring)
+ mock_file = six.StringIO(astring)
c.put_object(url='http://www.test.com', http_conn=conn,
headers={'Content-Length': str(astring_len)},
contents=mock_file)
@@ -707,7 +706,7 @@ class TestPutObject(MockHttpTest):
conn[1]._request = resp._fake_request
raw_data = 'asdf' * 256
chunk_size = 16
- mock_file = StringIO.StringIO(raw_data)
+ mock_file = six.StringIO(raw_data)
c.put_object(url='http://www.test.com', http_conn=conn,
contents=mock_file, chunk_size=chunk_size)