diff options
author | Christian Heimes <christian@cheimes.de> | 2013-02-15 13:52:52 +0100 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-02-15 13:52:52 +0100 |
commit | 07ee17021f3c4002d5d5d14cee836c4dc486abd6 (patch) | |
tree | 09dad7967121ad2eb314e43f32809b2bb5521f41 | |
parent | e5f270fa90f8701f8808925cf4d6e1d25d7cc3ea (diff) | |
download | defusedxml-07ee17021f3c4002d5d5d14cee836c4dc486abd6.tar.gz |
test another special case
-rw-r--r-- | tests.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -459,11 +459,11 @@ class TestDefusedGzip(DefusedTestCase): f.seek(0) return f - def decode_response(self, response, limit=None): + def decode_response(self, response, limit=None, readlength=1024): dec = xmlrpc.DefusedGzipDecodedResponse(response, limit) acc = [] while True: - data = dec.read(1024) + data = dec.read(readlength) if not data: break acc.append(data) @@ -497,6 +497,10 @@ class TestDefusedGzip(DefusedTestCase): response = self.get_gzipped(4096) self.decode_response(response, 4095) + with self.assertRaises(ValueError): + response = self.get_gzipped(4096) + self.decode_response(response, 4095, 8192) + def test_main(): suite = unittest.TestSuite() |