'Test chunked reponse for TestInfluxDBClient object.'

def test_chunked_response(self):

    example_response = u'{"results":[{"statement_id":0,"series":[{"name":"cpu","columns":["fieldKey","fieldType"],"values":[["value","integer"]]}],"partial":true}]}\n{"results":[{"statement_id":0,"series":[{"name":"iops","columns":["fieldKey","fieldType"],"values":[["value","integer"]]}],"partial":true}]}\n{"results":[{"statement_id":0,"series":[{"name":"load","columns":["fieldKey","fieldType"],"values":[["value","integer"]]}],"partial":true}]}\n{"results":[{"statement_id":0,"series":[{"name":"memory","columns":["fieldKey","fieldType"],"values":[["value","integer"]]}]}]}\n'
    with requests_mock.Mocker() as m:
        m.register_uri(requests_mock.GET, u'http://localhost:8086/query', text=example_response)
        response = self.cli.query(u'show    series    limit    4    offset    0', chunked=True, chunk_size=4)
        self.assertTrue((len(response) == 4))
        self.assertEqual(response.__repr__(), ResultSet({u'series': [{u'values': [[u'value', u'integer']], u'name': u'cpu', u'columns': [u'fieldKey', u'fieldType']}, {u'values': [[u'value', u'integer']], u'name': u'iops', u'columns': [u'fieldKey', u'fieldType']}, {u'values': [[u'value', u'integer']], u'name': u'load', u'columns': [u'fieldKey', u'fieldType']}, {u'values': [[u'value', u'integer']], u'name': u'memory', u'columns': [u'fieldKey', u'fieldType']}]}).__repr__())
