Skip to content

Commit e05df22

Browse files
committed
Add testcase of query()
1 parent ed17eda commit e05df22

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/influxdb/client_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ def test_query(self):
108108
result = cli.query('select column_one from foo;')
109109
assert len(json.loads(result)[0]['points']) == 4
110110

111+
@raises(Exception)
112+
def test_query_fail(self):
113+
with patch.object(requests, 'get') as mocked_get:
114+
mocked_get.return_value = _build_response_object(status_code=401)
115+
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
116+
cli.query('select column_one from foo;')
117+
111118
def test_create_database(self):
112119
with patch.object(requests, 'post') as mocked_post:
113120
mocked_post.return_value = _build_response_object(status_code=201)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy