def test_digest_result(self):
        plain_text = "Hello Plain Text"
        data = self.client._process_body(plain_text, False)
        self.assertEquals(plain_text, data)

        raw_json = '{"hello": "json"}'
        data = json.loads(self.client._process_body(raw_json, False))
        # Should parse as json into dict
        self.assertEquals(data.get('hello'), 'json')

        # Write our data into a gzipped stream
        sio = StringIO()
        gzf = GzipFile(fileobj=sio, mode='wb')
        gzf.write('{"hello": "gzipped"}')
        gzf.close()

        data = json.loads(self.client._process_body(sio.getvalue(), True))
        self.assertEquals(data.get('hello'), 'gzipped')
Test parsing returned data in various forms
dataset/ETHPy150Open HubSpot/hapipy/hapi/test/test_base.py/BaseTest.test_digest_result