Merge "StringIO compatibility for python3"

This commit is contained in:
Jenkins 2014-01-24 11:38:47 +00:00 committed by Gerrit Code Review
commit 7d6d24cbfa
2 changed files with 5 additions and 5 deletions

View File

@ -19,7 +19,7 @@
"""
import datetime
import logging
import StringIO
import six
import uuid
import mock
@ -46,7 +46,7 @@ class TestCoordinate(test.BaseTestCase):
self.partition_coordinator = coordination.PartitionCoordinator()
self.partition_coordinator.coordination_rpc = mock.Mock()
#add extra logger to check exception conditions and logged content
self.output = StringIO.StringIO()
self.output = six.moves.StringIO()
self.str_handler = logging.StreamHandler(self.output)
coordination.LOG.logger.addHandler(self.str_handler)

View File

@ -17,7 +17,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import cStringIO as StringIO
import six
import mock
import webob
@ -103,7 +103,7 @@ class TestSwiftMiddleware(test.BaseTestCase):
req = webob.Request.blank('/1.0/account/container/obj',
environ={'REQUEST_METHOD': 'PUT',
'wsgi.input':
StringIO.StringIO('some stuff')})
six.moves.cStringIO('some stuff')})
list(app(req.environ, self.start_response))
samples = self.pipeline_manager.pipelines[0].samples
self.assertEqual(len(samples), 2)
@ -124,7 +124,7 @@ class TestSwiftMiddleware(test.BaseTestCase):
req = webob.Request.blank(
'/1.0/account/container/obj',
environ={'REQUEST_METHOD': 'POST',
'wsgi.input': StringIO.StringIO('some other stuff')})
'wsgi.input': six.moves.cStringIO('some other stuff')})
list(app(req.environ, self.start_response))
samples = self.pipeline_manager.pipelines[0].samples
self.assertEqual(len(samples), 2)