Fix test_codeccallbacks.py: bytes has no % operator.

This commit is contained in:
Walter Dörwald 2007-06-06 15:17:22 +00:00
parent 933daed922
commit fee1af9d1c
1 changed files with 3 additions and 3 deletions

View File

@ -140,17 +140,17 @@ class CodecCallbackTest(unittest.TestCase):
sin += chr(sys.maxunicode)
sout = b"a\\xac\\u1234\\u20ac\\u8000"
if sys.maxunicode > 0xffff:
sout += b"\\U%08x" % sys.maxunicode
sout += bytes("\\U%08x" % sys.maxunicode)
self.assertEqual(sin.encode("ascii", "backslashreplace"), sout)
sout = b"a\xac\\u1234\\u20ac\\u8000"
if sys.maxunicode > 0xffff:
sout += b"\\U%08x" % sys.maxunicode
sout += bytes("\\U%08x" % sys.maxunicode)
self.assertEqual(sin.encode("latin-1", "backslashreplace"), sout)
sout = b"a\xac\\u1234\xa4\\u8000"
if sys.maxunicode > 0xffff:
sout += b"\\U%08x" % sys.maxunicode
sout += bytes("\\U%08x" % sys.maxunicode)
self.assertEqual(sin.encode("iso-8859-15", "backslashreplace"), sout)
def test_decoderelaxedutf8(self):