Back to index

python3.2  3.2.2
Public Member Functions
test.test_zlib.ExceptionTestCase Class Reference

List of all members.

Public Member Functions

def test_badlevel
def test_badargs
def test_badcompressobj
def test_baddecompressobj
def test_decompressobj_badflush

Detailed Description

Definition at line 89 of file test_zlib.py.


Member Function Documentation

Definition at line 97 of file test_zlib.py.

00097 
00098     def test_badargs(self):
00099         self.assertRaises(TypeError, zlib.adler32)
00100         self.assertRaises(TypeError, zlib.crc32)
00101         self.assertRaises(TypeError, zlib.compress)
00102         self.assertRaises(TypeError, zlib.decompress)
00103         for arg in (42, None, '', 'abc', (), []):
00104             self.assertRaises(TypeError, zlib.adler32, arg)
00105             self.assertRaises(TypeError, zlib.crc32, arg)
00106             self.assertRaises(TypeError, zlib.compress, arg)
00107             self.assertRaises(TypeError, zlib.decompress, arg)

Here is the call graph for this function:

Definition at line 108 of file test_zlib.py.

00108 
00109     def test_badcompressobj(self):
00110         # verify failure on building compress object with bad params
00111         self.assertRaises(ValueError, zlib.compressobj, 1, zlib.DEFLATED, 0)
00112         # specifying total bits too large causes an error
00113         self.assertRaises(ValueError,
00114                 zlib.compressobj, 1, zlib.DEFLATED, zlib.MAX_WBITS + 1)

Here is the call graph for this function:

Definition at line 115 of file test_zlib.py.

00115 
00116     def test_baddecompressobj(self):
00117         # verify failure on building decompress object with bad params
00118         self.assertRaises(ValueError, zlib.decompressobj, -1)

Here is the call graph for this function:

Definition at line 91 of file test_zlib.py.

00091 
00092     def test_badlevel(self):
00093         # specifying compression level out of range causes an error
00094         # (but -1 is Z_DEFAULT_COMPRESSION and apparently the zlib
00095         # accepts 0 too)
00096         self.assertRaises(zlib.error, zlib.compress, b'ERROR', 10)

Here is the call graph for this function:

Definition at line 119 of file test_zlib.py.

00119 
00120     def test_decompressobj_badflush(self):
00121         # verify failure on calling decompressobj.flush with bad params
00122         self.assertRaises(ValueError, zlib.decompressobj().flush, 0)
00123         self.assertRaises(ValueError, zlib.decompressobj().flush, -1)
00124 

Here is the call graph for this function:


The documentation for this class was generated from the following file: