def parse_content_encoding(self, response_headers, response_data):
        """
        Parses a response that contains Content-Encoding to retrieve
        response_data
        """
        if response_headers['content-encoding'] == 'gzip':
            buf = StringIO.StringIO(response_data)
            zipbuf = gzip.GzipFile(fileobj=buf)
            response_data = zipbuf.read()
        elif response_headers['content-encoding'] == 'deflate':
            data = StringIO.StringIO(zlib.decompress(response_data))
            response_data = data.read()
        else:
            raise errors.TestError(
                'Received unknown Content-Encoding',
                {
                    'content-encoding':
                        str(response_headers['content-encoding']),
                    'function': 'http.HttpResponse.parse_content_encoding'
                })
        return response_data
def parse_content_encoding ( self , response_headers , response_data ) : if response_headers [ 'content-encoding' ] == 'gzip' : buf = StringIO . StringIO ( response_data ) zipbuf = gzip . GzipFile ( fileobj = buf ) response_data = zipbuf . read ( ) elif response_headers [ 'content-encoding' ] == 'deflate' : data = StringIO . StringIO ( zlib . decompress ( response_data ) ) response_data = data . read ( ) else : raise errors . TestError ( 'Received unknown Content-Encoding' , { 'content-encoding' : str ( response_headers [ 'content-encoding' ] ) , 'function' : 'http.HttpResponse.parse_content_encoding' } ) return response_data
Parses a response that contains Content-Encoding to retrieve
        response_data