Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.

Commit

Permalink
Updated chunked responses test for API change
Browse files Browse the repository at this point in the history
  • Loading branch information
Panos committed Feb 21, 2017
1 parent 3625e4c commit 0c2e171
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions influxdb/tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,22 +812,23 @@ def test_chunked_response(self):
"http://localhost:8086/query",
text=example_response
)
response = list(self.cli.query('show series limit 4 offset 0',
chunked=True, chunk_size=4))
response = self.cli.query('show series limit 4 offset 0',
chunked=True, chunk_size=4)
self.assertTrue(len(response) == 4)
self.assertEqual(response[0].raw, ResultSet(
{"statement_id": 0,
"series": [{"name": "cpu",
"columns": ["fieldKey", "fieldType"],
"values": [["value", "integer"]]}],
"partial": True}
).raw)
self.assertEqual(response[3].raw, ResultSet(
{"statement_id": 0,
"series": [{"name": "memory",
"columns": ["fieldKey", "fieldType"],
"values": [["value", "integer"]]}]}
).raw)
self.assertEqual(response.__repr__(), ResultSet(
{'series': [{'values': [['value', 'integer']],
'name': 'cpu',
'columns': ['fieldKey', 'fieldType']},
{'values': [['value', 'integer']],
'name': 'iops',
'columns': ['fieldKey', 'fieldType']},
{'values': [['value', 'integer']],
'name': 'load',
'columns': ['fieldKey', 'fieldType']},
{'values': [['value', 'integer']],
'name': 'memory',
'columns': ['fieldKey', 'fieldType']}]}
).__repr__())


class FakeClient(InfluxDBClient):
Expand Down

0 comments on commit 0c2e171

Please sign in to comment.