diff options
author | Georg Brandl <georg@python.org> | 2007-10-24 18:55:37 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-10-24 18:55:37 (GMT) |
commit | bd1c68c94f0d5bc25b48f62c7527f51c754f2b6b (patch) | |
tree | a468fcccf4193f6d26ce71246e2596de6ffc9eec /Lib/test/test_codeccallbacks.py | |
parent | 97f9d4f31224e72e5c714ea7e509c4fd0044f0e2 (diff) | |
download | cpython-bd1c68c94f0d5bc25b48f62c7527f51c754f2b6b.zip cpython-bd1c68c94f0d5bc25b48f62c7527f51c754f2b6b.tar.gz cpython-bd1c68c94f0d5bc25b48f62c7527f51c754f2b6b.tar.bz2 |
Patch #1303: Adapt str8 constructor to bytes (now buffer) one.
Diffstat (limited to 'Lib/test/test_codeccallbacks.py')
-rw-r--r-- | Lib/test/test_codeccallbacks.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_codeccallbacks.py b/Lib/test/test_codeccallbacks.py index eedd48a..0256eb6 100644 --- a/Lib/test/test_codeccallbacks.py +++ b/Lib/test/test_codeccallbacks.py @@ -181,7 +181,7 @@ class CodecCallbackTest(unittest.TestCase): # mapped through the encoding again. This means, that # to be able to use e.g. the "replace" handler, the # charmap has to have a mapping for "?". - charmap = dict((ord(c), str8(2*c.upper())) for c in "abcdefgh") + charmap = dict((ord(c), str8(2*c.upper(), 'ascii')) for c in "abcdefgh") sin = "abc" sout = b"AABBCC" self.assertEquals(codecs.charmap_encode(sin, "strict", charmap)[0], sout) @@ -189,7 +189,7 @@ class CodecCallbackTest(unittest.TestCase): sin = "abcA" self.assertRaises(UnicodeError, codecs.charmap_encode, sin, "strict", charmap) - charmap[ord("?")] = str8("XYZ") + charmap[ord("?")] = str8(b"XYZ") sin = "abcDEF" sout = b"AABBCCXYZXYZXYZ" self.assertEquals(codecs.charmap_encode(sin, "replace", charmap)[0], sout) @@ -309,7 +309,7 @@ class CodecCallbackTest(unittest.TestCase): # check with one argument too much self.assertRaises(TypeError, exctype, *(args + ["too much"])) # check with one argument of the wrong type - wrongargs = [ "spam", str8("eggs"), b"spam", 42, 1.0, None ] + wrongargs = [ "spam", str8(b"eggs"), b"spam", 42, 1.0, None ] for i in range(len(args)): for wrongarg in wrongargs: if type(wrongarg) is type(args[i]): |