Fix test_codeccallbacks.py: bytes has no % operator.
This commit is contained in:
parent
933daed922
commit
fee1af9d1c
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue