def test_response_transparently_decrypts_wrong_deflate(self):
        c = zlib_compressobj(wbits=-zlib.MAX_WBITS)
        body = c.compress(b'this is test data')
        body += c.flush()
        body_len = ('%s' % len(body)).encode('ascii')

        headers = {
            b'content-encoding': [b'deflate'], b'content-length': [body_len]
        }
        d = DummySocket()
        d._buffer = BytesIO(body)
        r = HTTP11Response(200, 'OK', headers, d, None)

        assert r.read() == b'this is test data'
dataset/ETHPy150Open Lukasa/hyper/test/test_http11.py/TestHTTP11Response.test_response_transparently_decrypts_wrong_deflate/original