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
This commit is contained in:
@@ -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": [
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user