Tests: Fix failing ipatests/test_ipalib/test_errors.py

Some strings in the testsuite are unicode which wasn't reflected in the tests. This patch fixes the problem by changing concerned strings to unicode.

Reviewed-By: Ganna Kaihorodova <gkaihoro@redhat.com>
This commit is contained in:
Lenka Doudova 2016-06-20 10:29:26 +02:00 committed by Martin Basti
parent 31a13c9e98
commit f37c3af0db

View File

@ -244,8 +244,8 @@ class test_PublicError(PublicExceptionTester):
message = u'The translated, interpolated message'
format = 'key=%(key1)r and key2=%(key2)r'
uformat = u'Translated key=%(key1)r and key2=%(key2)r'
val1 = 'Value 1'
val2 = 'Value 2'
val1 = u'Value 1'
val2 = u'Value 2'
kw = dict(key1=val1, key2=val2)
# Test with format=str, message=None
@ -304,7 +304,7 @@ class test_PublicError(PublicExceptionTester):
format = '%(true)r %(text)r %(number)r'
uformat = u'Translated %(true)r %(text)r %(number)r'
kw = dict(true=True, text='Hello!', number=18)
kw = dict(true=True, text=u'Hello!', number=18)
# Test with format=str, message=None
e = raises(ValueError, subclass, format, **kw)
@ -342,7 +342,7 @@ class test_PublicError(PublicExceptionTester):
'$')
inst = subclass(instructions=instructions, **kw)
assert inst.format is subclass.format
assert_equal(inst.instructions, instructions)
assert_equal(inst.instructions, unicode(instructions))
inst_match = regexp.match(inst.strerror).groups()
assert_equal(list(inst_match),list(instructions))