summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2007-10-15 07:48:35 (GMT)
committerArmin Rigo <arigo@tunes.org>2007-10-15 07:48:35 (GMT)
commitec5601945adc4fe16b8263305e825b216355a712 (patch)
tree22684276dfa2440a27c47d2ccd4515a069c505a0
parentd29f1d2241f3ad30fffc7086b690d8d6515bc6db (diff)
downloadcpython-ec5601945adc4fe16b8263305e825b216355a712.zip
cpython-ec5601945adc4fe16b8263305e825b216355a712.tar.gz
cpython-ec5601945adc4fe16b8263305e825b216355a712.tar.bz2
test_bigbits was not testing what it seemed to.
-rw-r--r--Lib/test/test_zlib.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py
index b8594de..13926e1 100644
--- a/Lib/test/test_zlib.py
+++ b/Lib/test/test_zlib.py
@@ -42,14 +42,18 @@ class ChecksumTestCase(unittest.TestCase):
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