summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorzhang-jinnan <ben.os@99cloud.net>2014-02-19 21:14:14 +0800
committerzhang-jinnan <ben.os@99cloud.net>2014-03-03 16:16:07 +0800
commit26e644f7bbd8fe6af43024a3da8f12d2e0f92a9d (patch)
treed2828bc319c2ebe5be9913425f706a8add6ea13d /tests
parent52893e3ce548af98d6b5d30cdda37e7f3da7122f (diff)
downloadpython-swiftclient-26e644f7bbd8fe6af43024a3da8f12d2e0f92a9d.tar.gz
Use six.StringIO instead of StringIO.StringIO
Keep Python 3.x compatibility Change-Id: If7a8f0630bd2582ca9488313dcc59805c2ce1835
Diffstat (limited to 'tests')
-rw-r--r--tests/test_command_helpers.py2
-rw-r--r--tests/test_swiftclient.py6
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_command_helpers.py b/tests/test_command_helpers.py
index 225805b..140e915 100644
--- a/tests/test_command_helpers.py
+++ b/tests/test_command_helpers.py
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from StringIO import StringIO
+from six import StringIO
import mock
import testtools
diff --git a/tests/test_swiftclient.py b/tests/test_swiftclient.py
index cb7a0c0..b57bf9f 100644
--- a/tests/test_swiftclient.py
+++ b/tests/test_swiftclient.py
@@ -16,8 +16,8 @@
# TODO: More tests
import mock
import logging
+import six
import socket
-import StringIO
import testtools
import warnings
from urlparse import urlparse
@@ -576,7 +576,7 @@ class TestPutObject(MockHttpTest):
def test_unicode_ok(self):
conn = c.http_connection(u'http://www.test.com/')
- mock_file = StringIO.StringIO(u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91')
+ mock_file = six.StringIO(u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91')
args = (u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91',
'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91',
u'\u5929\u7a7a\u4e2d\u7684\u4e4c\u4e91',
@@ -596,7 +596,7 @@ class TestPutObject(MockHttpTest):
def test_chunk_warning(self):
conn = c.http_connection('http://www.test.com/')
- mock_file = StringIO.StringIO('asdf')
+ mock_file = six.StringIO('asdf')
args = ('asdf', 'asdf', 'asdf', 'asdf', mock_file)
resp = MockHttpResponse()
conn[1].getresponse = resp.fake_response