Merge "use six.StringIO for compatibility with io.StringIO in python3"
This commit is contained in:
@@ -13,7 +13,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import cStringIO
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@@ -21,6 +20,7 @@ import uuid
|
|||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
import mock
|
import mock
|
||||||
|
import six
|
||||||
import testtools
|
import testtools
|
||||||
from testtools import matchers
|
from testtools import matchers
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class ShellTest(utils.TestCase):
|
|||||||
clean_env = {}
|
clean_env = {}
|
||||||
_old_env, os.environ = os.environ, clean_env.copy()
|
_old_env, os.environ = os.environ, clean_env.copy()
|
||||||
try:
|
try:
|
||||||
sys.stdout = cStringIO.StringIO()
|
sys.stdout = six.StringIO()
|
||||||
_shell = openstack_shell.OpenStackIdentityShell()
|
_shell = openstack_shell.OpenStackIdentityShell()
|
||||||
_shell.main(argstr.split())
|
_shell.main(argstr.split())
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
|
@@ -12,11 +12,11 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import cStringIO
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from mox3 import stubout
|
from mox3 import stubout
|
||||||
|
import six
|
||||||
from testtools import matchers
|
from testtools import matchers
|
||||||
|
|
||||||
from keystoneclient import httpclient
|
from keystoneclient import httpclient
|
||||||
@@ -69,7 +69,7 @@ class ShellTests(utils.TestCase):
|
|||||||
def run_command(self, cmd):
|
def run_command(self, cmd):
|
||||||
orig = sys.stdout
|
orig = sys.stdout
|
||||||
try:
|
try:
|
||||||
sys.stdout = cStringIO.StringIO()
|
sys.stdout = six.StringIO()
|
||||||
if isinstance(cmd, list):
|
if isinstance(cmd, list):
|
||||||
self.shell.main(cmd)
|
self.shell.main(cmd)
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user