Skip to content

Commit d0b87e3

Browse files
author
aviau
committed
Added test_query_bad_precision
1 parent 0818132 commit d0b87e3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/influxdb/client_test.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,14 @@ def test_query_fail(self):
217217
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')
218218
cli.query('select column_one from foo;')
219219

220+
def test_query_bad_precision(self):
221+
cli = InfluxDBClient()
222+
with self.assertRaisesRegexp(
223+
Exception,
224+
"Invalid time precision is given. \(use 's', 'm', 'ms' or 'u'\)"
225+
):
226+
cli.query('select column_one from foo', time_precision='g')
227+
220228
def test_create_database(self):
221229
with _mocked_session('post', 201, {"name": "new_db"}):
222230
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')

0 commit comments

Comments
 (0)