From 2d1cc878033c9dee997c12f937bd92f32599071b Mon Sep 17 00:00:00 2001 From: Thomas Goirand Date: Sun, 15 Jun 2014 11:14:08 +0800 Subject: [PATCH] Using six.u('') instead of u'' In a few places, there's some u'' strings, this patch replaces them by six.u(''), as this fixes things when running the unit tests in Debian Wheezy. Change-Id: I60c01f85901a33a0e3e7a255049084126558f031 --- keystoneclient/tests/test_discovery.py | 2 +- keystoneclient/tests/test_utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keystoneclient/tests/test_discovery.py b/keystoneclient/tests/test_discovery.py index 59289857c..7d8b47112 100644 --- a/keystoneclient/tests/test_discovery.py +++ b/keystoneclient/tests/test_discovery.py @@ -119,7 +119,7 @@ V3_VERSION = {'id': 'v3.0', 'status': 'stable', 'updated': UPDATED} -V3_TOKEN = u'3e2813b7ba0b4006840c3825860b86ed', +V3_TOKEN = six.u('3e2813b7ba0b4006840c3825860b86ed'), V3_AUTH_RESPONSE = jsonutils.dumps({ "token": { "methods": [ diff --git a/keystoneclient/tests/test_utils.py b/keystoneclient/tests/test_utils.py index a55978a0c..01131e6f1 100644 --- a/keystoneclient/tests/test_utils.py +++ b/keystoneclient/tests/test_utils.py @@ -114,7 +114,7 @@ class PrintTestCase(test_utils.TestCase): self.addCleanup(setattr, sys, 'stdout', self.old_stdout) def test_print_list_unicode(self): - name = u'\u540d\u5b57' + name = six.u('\u540d\u5b57') objs = [FakeObject(name)] # NOTE(Jeffrey4l) If the text's encode is proper, this method will not # raise UnicodeEncodeError exceptions @@ -127,7 +127,7 @@ class PrintTestCase(test_utils.TestCase): self.assertIn(name, output) def test_print_dict_unicode(self): - name = u'\u540d\u5b57' + name = six.u('\u540d\u5b57') utils.print_dict({'name': name}) output = self.stdout.getvalue() # In Python 2, output will be bytes, while in Python 3, it will not.