diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2008-09-06 20:13:06 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2008-09-06 20:13:06 (GMT) |
commit | 693fc4604f9dd251949638228e282a0c8757b4ca (patch) | |
tree | 629b595fbfce66cfb0743a9d22fb6c4107380740 /Lib/test | |
parent | 35e661c7115256290e7abbf62f9d0bc602dfeac3 (diff) | |
download | cpython-693fc4604f9dd251949638228e282a0c8757b4ca.zip cpython-693fc4604f9dd251949638228e282a0c8757b4ca.tar.gz cpython-693fc4604f9dd251949638228e282a0c8757b4ca.tar.bz2 |
Fixes release blocker issue #3492 and #3790.
Make zlib and zipimport to return bytes instead of bytearray and use bytes
rather than bytearray for their internal leftover data storages.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_zlib.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index b5f3fe5..f52aa5e 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -110,6 +110,8 @@ class CompressObjectTestCase(unittest.TestCase): y1 = dco.decompress(x1 + x2) y2 = dco.flush() self.assertEqual(data, y1 + y2) + self.assert_(isinstance(dco.unconsumed_tail, bytes)) + self.assert_(isinstance(dco.unused_data, bytes)) def test_compressoptions(self): # specify lots of options to compressobj() @@ -152,7 +154,11 @@ class CompressObjectTestCase(unittest.TestCase): bufs.append(co.flush()) combuf = b''.join(bufs) - self.assertEqual(data, zlib.decompress(combuf)) + decombuf = zlib.decompress(combuf) + # Test type of return value + self.assert_(isinstance(decombuf, bytes)) + + self.assertEqual(data, decombuf) dco = zlib.decompressobj() bufs = [] @@ -348,6 +354,8 @@ class CompressObjectTestCase(unittest.TestCase): # Test copying a decompression object data = HAMLET_SCENE comp = zlib.compress(data) + # Test type of return value + self.assert_(isinstance(comp, bytes)) d0 = zlib.decompressobj() bufs0 = [] |