Kaydet (Commit) ec560194 authored tarafından Armin Rigo's avatar Armin Rigo

test_bigbits was not testing what it seemed to.

üst d29f1d22
...@@ -42,14 +42,18 @@ class ChecksumTestCase(unittest.TestCase): ...@@ -42,14 +42,18 @@ class ChecksumTestCase(unittest.TestCase):
class ExceptionTestCase(unittest.TestCase): class ExceptionTestCase(unittest.TestCase):
# make sure we generate some expected errors # make sure we generate some expected errors
def test_bigbits(self): def test_badlevel(self):
# specifying total bits too large causes an error # specifying compression level out of range causes an error
self.assertRaises(zlib.error, # (but -1 is Z_DEFAULT_COMPRESSION and apparently the zlib
zlib.compress, 'ERROR', zlib.MAX_WBITS + 1) # accepts 0 too)
self.assertRaises(zlib.error, zlib.compress, 'ERROR', 10)
def test_badcompressobj(self): def test_badcompressobj(self):
# verify failure on building compress object with bad params # verify failure on building compress object with bad params
self.assertRaises(ValueError, zlib.compressobj, 1, zlib.DEFLATED, 0) 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): def test_baddecompressobj(self):
# verify failure on building decompress object with bad params # verify failure on building decompress object with bad params
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment