py33: use six.StringIO() to mock stdout/stderr

six.StringIO() is the right way to keep Python2/3 compatibiliby
while mocking stdout/stderr.

Close-Bug #1235086

Change-Id: I33d9223b2202896331d24339056d57d4ca9acdc5
This commit is contained in:
Kui Shi 2013-10-04 17:44:04 +08:00
parent aadaf23b5e
commit 5f0363ad9d

@ -21,7 +21,6 @@ import datetime
import os
import mock
import sys
import tempfile
import fixtures
import six
@ -646,7 +645,7 @@ class ShellTest(utils.TestCase):
self.assert_called('DELETE', '/images/1/metadata/test_key')
def test_image_meta_bad_action(self):
tmp = tempfile.TemporaryFile()
tmp = six.StringIO()
# Suppress stdout and stderr
(stdout, stderr) = (sys.stdout, sys.stderr)