summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/test_zli.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-04-08 20:27:54 (GMT)
committerGuido van Rossum <guido@python.org>1999-04-08 20:27:54 (GMT)
commit9a744a9dd771ee8997bdebaf47ff999b5adc9733 (patch)
tree5060172f273b17409371c9ad1441b2a8bbc315be /Lib/dos-8x3/test_zli.py
parent6d0de99d8da806798ce0b896159bd07fce71c0dc (diff)
downloadcpython-9a744a9dd771ee8997bdebaf47ff999b5adc9733.zip
cpython-9a744a9dd771ee8997bdebaf47ff999b5adc9733.tar.gz
cpython-9a744a9dd771ee8997bdebaf47ff999b5adc9733.tar.bz2
The usual
Diffstat (limited to 'Lib/dos-8x3/test_zli.py')
-rw-r--r--Lib/dos-8x3/test_zli.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/dos-8x3/test_zli.py b/Lib/dos-8x3/test_zli.py
index 047e985..719b0e7 100644
--- a/Lib/dos-8x3/test_zli.py
+++ b/Lib/dos-8x3/test_zli.py
@@ -76,6 +76,19 @@ if decomp2 != buf:
else:
print "decompressobj with init options succeeded"
+# Test flush() with the various options, using all the different levels
+# in order to provide more variations.
+for sync in [zlib.Z_NO_FLUSH, zlib.Z_SYNC_FLUSH, zlib.Z_FULL_FLUSH]:
+ for level in range(10):
+ obj = zlib.compressobj( level )
+ d = obj.compress( buf[:3000] )
+ d = d + obj.flush( sync )
+ d = d + obj.compress( buf[3000:] )
+ d = d + obj.flush()
+ if zlib.decompress(d) != buf:
+ print "Decompress failed: flush mode=%i, level=%i" % (sync,level)
+ del obj
+
def ignore():
"""An empty function with a big string.