Merge "StringIO compatibility for python3"
This commit is contained in:
commit
7d6d24cbfa
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user