mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
#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:
parent
de0ab5eab3
commit
02524629f3
17 changed files with 900 additions and 29 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue