diff options
| author | Kui Shi <skuicloud@gmail.com> | 2013-10-14 16:52:23 +0800 |
|---|---|---|
| committer | Kui Shi <skuicloud@gmail.com> | 2013-10-14 17:15:47 +0800 |
| commit | eaae72edc92940b0e46b7d7b955e2bfbe94542c5 (patch) | |
| tree | a6134178575bf0685c5536aaaae08555adf51b5f /ceilometerclient | |
| parent | c3283ec1e861f29a53c59c1a09f2a1bc21a713e4 (diff) | |
| download | python-ceilometerclient-eaae72edc92940b0e46b7d7b955e2bfbe94542c5.tar.gz | |
Import six.StringIO
six.StringIO
This is an fake file object for textual data. It is an alias for
StringIO.StringIO in Python 2 and io.StringIO in Python 3.
Partial Implement: blueprint py33-support
Change-Id: I76c05041565614241eea7b7595e4503c88211ee8
Diffstat (limited to 'ceilometerclient')
| -rw-r--r-- | ceilometerclient/tests/test_shell.py | 4 | ||||
| -rw-r--r-- | ceilometerclient/tests/test_utils.py | 4 | ||||
| -rw-r--r-- | ceilometerclient/tests/v2/test_shell.py | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/ceilometerclient/tests/test_shell.py b/ceilometerclient/tests/test_shell.py index ee09e16..7c01df5 100644 --- a/ceilometerclient/tests/test_shell.py +++ b/ceilometerclient/tests/test_shell.py @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. -import cStringIO import httplib2 import re +import six import sys import fixtures @@ -48,7 +48,7 @@ class ShellTest(utils.BaseTestCase): def shell(self, argstr): orig = sys.stdout try: - sys.stdout = cStringIO.StringIO() + sys.stdout = six.StringIO() _shell = ceilometer_shell.CeilometerShell() _shell.main(argstr.split()) except SystemExit: diff --git a/ceilometerclient/tests/test_utils.py b/ceilometerclient/tests/test_utils.py index e0626af..30ba31c 100644 --- a/ceilometerclient/tests/test_utils.py +++ b/ceilometerclient/tests/test_utils.py @@ -14,7 +14,7 @@ # under the License. -import cStringIO +import six import sys from ceilometerclient.common import utils @@ -31,7 +31,7 @@ class UtilsTest(test_utils.BaseTestCase): # test that the prettytable output is wellformatted (left-aligned) saved_stdout = sys.stdout try: - sys.stdout = output_dict = cStringIO.StringIO() + sys.stdout = output_dict = six.StringIO() utils.print_dict({'K': 'k', 'Key': 'Value'}) finally: diff --git a/ceilometerclient/tests/v2/test_shell.py b/ceilometerclient/tests/v2/test_shell.py index 402343b..6392e44 100644 --- a/ceilometerclient/tests/v2/test_shell.py +++ b/ceilometerclient/tests/v2/test_shell.py @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. -import cStringIO import mock import re +import six import sys from testtools import matchers @@ -102,7 +102,7 @@ class ShellAlarmHistoryCommandTest(utils.BaseTestCase): def _do_test_alarm_history(self, raw_query=None, parsed_query=None): self.args.query = raw_query orig = sys.stdout - sys.stdout = cStringIO.StringIO() + sys.stdout = six.StringIO() history = [alarms.AlarmChange(mock.Mock(), change) for change in self.ALARM_HISTORY] self.cc.alarms.get_history.return_value = history |
