Merge "Fix up StringIO use in tests for py3"
This commit is contained in:
commit
b9bd897639
@ -24,7 +24,6 @@ except ImportError:
|
|||||||
import six
|
import six
|
||||||
import socket
|
import socket
|
||||||
import types
|
import types
|
||||||
import StringIO
|
|
||||||
import testtools
|
import testtools
|
||||||
import warnings
|
import warnings
|
||||||
from six.moves.urllib.parse import urlparse
|
from six.moves.urllib.parse import urlparse
|
||||||
@ -681,7 +680,7 @@ class TestPutObject(MockHttpTest):
|
|||||||
conn[1]._request = resp._fake_request
|
conn[1]._request = resp._fake_request
|
||||||
astring = 'asdf'
|
astring = 'asdf'
|
||||||
astring_len = len(astring)
|
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,
|
c.put_object(url='http://www.test.com', http_conn=conn,
|
||||||
contents=mock_file, content_length=astring_len)
|
contents=mock_file, content_length=astring_len)
|
||||||
@ -690,7 +689,7 @@ class TestPutObject(MockHttpTest):
|
|||||||
self.assertEqual(astring_len,
|
self.assertEqual(astring_len,
|
||||||
len(resp.requests_params['data'].read()))
|
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,
|
c.put_object(url='http://www.test.com', http_conn=conn,
|
||||||
headers={'Content-Length': str(astring_len)},
|
headers={'Content-Length': str(astring_len)},
|
||||||
contents=mock_file)
|
contents=mock_file)
|
||||||
@ -707,7 +706,7 @@ class TestPutObject(MockHttpTest):
|
|||||||
conn[1]._request = resp._fake_request
|
conn[1]._request = resp._fake_request
|
||||||
raw_data = 'asdf' * 256
|
raw_data = 'asdf' * 256
|
||||||
chunk_size = 16
|
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,
|
c.put_object(url='http://www.test.com', http_conn=conn,
|
||||||
contents=mock_file, chunk_size=chunk_size)
|
contents=mock_file, chunk_size=chunk_size)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user