diff Lib/test/test_bytes.py @ 66605:7e4833764c88

#7475: add (un)transform method to bytes/bytearray and str, add back codecs that can be used with them from Python 2.
author Georg Brandl <georg@python.org>
date Thu, 02 Dec 2010 18:06:51 +0000
parents 9fe76c26ea9f
children a811f7c10e82
line wrap: on
line diff
--- a/Lib/test/test_bytes.py	Thu Dec 02 18:02:01 2010 +0000
+++ b/Lib/test/test_bytes.py	Thu Dec 02 18:06:51 2010 +0000
@@ -207,6 +207,11 @@
         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())