Fix cString ImportError for py34

Here cString dose not exist in py3.x. This patch is used to
fix py34 gate errors.

Partial-Bug: #1612071

Change-Id: I0a36777cba8c4602c16be771956d4cd26f7e979f
This commit is contained in:
Lu lei 2016-08-11 16:38:08 +08:00
parent 6b677a8f38
commit 45ebce43cb
2 changed files with 4 additions and 5 deletions
tackerclient/tests/unit

@ -17,7 +17,6 @@
import urllib
import contextlib
import cStringIO
import fixtures
import mox
import six
@ -38,7 +37,7 @@ ENDURL = 'localurl'
@contextlib.contextmanager
def capture_std_streams():
fake_stdout, fake_stderr = cStringIO.StringIO(), cStringIO.StringIO()
fake_stdout, fake_stderr = six.StringIO(), six.StringIO()
stdout, stderr = sys.stdout, sys.stderr
try:
sys.stdout, sys.stderr = fake_stdout, fake_stderr

@ -14,10 +14,10 @@
# under the License.
import argparse
import cStringIO
import logging
import os
import re
import six
import sys
import fixtures
@ -61,8 +61,8 @@ class ShellTest(testtools.TestCase):
clean_env = {}
_old_env, os.environ = os.environ, clean_env.copy()
try:
sys.stdout = cStringIO.StringIO()
sys.stderr = cStringIO.StringIO()
sys.stdout = six.StringIO()
sys.stderr = six.StringIO()
_shell = openstack_shell.TackerShell('1.0')
_shell.run(argstr.split())
except SystemExit: