[Python-checkins] r58468 - python/trunk/Lib/test/test_zlib.py
armin.rigo
python-checkins at python.org
Mon Oct 15 09:48:36 CEST 2007
Author: armin.rigo
Date: Mon Oct 15 09:48:35 2007
New Revision: 58468
Modified:
python/trunk/Lib/test/test_zlib.py
Log:
test_bigbits was not testing what it seemed to.
Modified: python/trunk/Lib/test/test_zlib.py
==============================================================================
--- python/trunk/Lib/test/test_zlib.py (original)
+++ python/trunk/Lib/test/test_zlib.py Mon Oct 15 09:48:35 2007
@@ -42,14 +42,18 @@
class ExceptionTestCase(unittest.TestCase):
# make sure we generate some expected errors
- def test_bigbits(self):
- # specifying total bits too large causes an error
- self.assertRaises(zlib.error,
- zlib.compress, 'ERROR', zlib.MAX_WBITS + 1)
+ def test_badlevel(self):
+ # specifying compression level out of range causes an error
+ # (but -1 is Z_DEFAULT_COMPRESSION and apparently the zlib
+ # accepts 0 too)
+ self.assertRaises(zlib.error, zlib.compress, 'ERROR', 10)
def test_badcompressobj(self):
# verify failure on building compress object with bad params
self.assertRaises(ValueError, zlib.compressobj, 1, zlib.DEFLATED, 0)
+ # specifying total bits too large causes an error
+ self.assertRaises(ValueError,
+ zlib.compressobj, 1, zlib.DEFLATED, zlib.MAX_WBITS + 1)
def test_baddecompressobj(self):
# verify failure on building decompress object with bad params
More information about the Python-checkins
mailing list