#7475: add (un)transform method to bytes/bytearray and str, add back codecs that can be used with them from Python 2.

This commit is contained in:
Georg Brandl 2010-12-02 18:06:51 +00:00
parent de0ab5eab3
commit 02524629f3
17 changed files with 900 additions and 29 deletions

View file

@ -207,6 +207,11 @@ class BaseBytesTest(unittest.TestCase):
self.assertEqual(b.decode(errors="ignore", encoding="utf8"),
"Hello world\n")
def test_transform(self):
b1 = self.type2test(range(256))
b2 = b1.transform("base64").untransform("base64")
self.assertEqual(b2, b1)
def test_from_int(self):
b = self.type2test(0)
self.assertEqual(b, self.type2test())