'If the data received by the L{GzipDecoder} isn\'t valid gzip-compressed
data, the call to C{deliverBody} fails with a C{zlib.error}.'

def test_brokenContent(self):

    deferred = self.agent.request('GET', 'http://example.com/foo')
    (req, res) = self.protocol.requests.pop()
    headers = http_headers.Headers({'foo': ['bar'], 'content-encoding': ['gzip']})
    transport = StringTransport()
    response = Response(('HTTP', 1, 1), 200, 'OK', headers, transport)
    response.length = 12
    res.callback(response)
    data = 'not    gzipped    content'
    def checkResponse(result):
        response._bodyDataReceived(data)
        result.deliverBody(Protocol())
    deferred.addCallback(checkResponse)
    self.assertFailure(deferred, client.ResponseFailed)
    def checkFailure(error):
        error.reasons[0].trap(zlib.error)
        self.assertIsInstance(error.response, Response)
    return deferred.addCallback(checkFailure)
