summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_zlib.py
diff options
context:
space:
mode:
authorNadeem Vawda <nadeem.vawda@gmail.com>2012-06-21 22:35:57 (GMT)
committerNadeem Vawda <nadeem.vawda@gmail.com>2012-06-21 22:35:57 (GMT)
commitcf5e1d82e3c0910f094727b6ef8e2a63da9ed8cf (patch)
tree29b27886df60b1714825cbc2446dfa8a47189301 /Lib/test/test_zlib.py
parenta425c3d5a264c556d31bdd88097c79246b533ea3 (diff)
downloadcpython-cf5e1d82e3c0910f094727b6ef8e2a63da9ed8cf.zip
cpython-cf5e1d82e3c0910f094727b6ef8e2a63da9ed8cf.tar.gz
cpython-cf5e1d82e3c0910f094727b6ef8e2a63da9ed8cf.tar.bz2
Tidy up comments from dd4f7d5c51c7 (zlib compression dictionary support).
Diffstat (limited to 'Lib/test/test_zlib.py')
-rw-r--r--Lib/test/test_zlib.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index 904ac4d..d637c2d 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -427,24 +427,23 @@ class CompressObjectTestCase(BaseCompressTestCase, unittest.TestCase):
def test_dictionary(self):
h = HAMLET_SCENE
- # build a simulated dictionary out of the words in HAMLET
+ # Build a simulated dictionary out of the words in HAMLET.
words = h.split()
random.shuffle(words)
zdict = b''.join(words)
- # use it to compress HAMLET
+ # Use it to compress HAMLET.
co = zlib.compressobj(zdict=zdict)
cd = co.compress(h) + co.flush()
- # verify that it will decompress with the dictionary
+ # Verify that it will decompress with the dictionary.
dco = zlib.decompressobj(zdict=zdict)
self.assertEqual(dco.decompress(cd) + dco.flush(), h)
- # verify that it fails when not given the dictionary
+ # Verify that it fails when not given the dictionary.
dco = zlib.decompressobj()
self.assertRaises(zlib.error, dco.decompress, cd)
def test_dictionary_streaming(self):
- # this is simulating the needs of SPDY to be able to reuse the same
- # stream object (with its compression state) between sets of compressed
- # headers.
+ # This simulates the reuse of a compressor object for compressing
+ # several separate data streams.
co = zlib.compressobj(zdict=HAMLET_SCENE)
do = zlib.decompressobj(zdict=HAMLET_SCENE)
piece = HAMLET_SCENE[1000:1500]