@@ -62,8 +62,8 @@ def request(*args, **kwargs):
62
62
class TestInfluxDBClient (unittest .TestCase ):
63
63
64
64
def setUp (self ):
65
- # By default, ignore warnings
66
- warnings .simplefilter ('ignore ' , FutureWarning )
65
+ # By default, raise exceptions on warnings
66
+ warnings .simplefilter ('error ' , FutureWarning )
67
67
68
68
self .dummy_points = [
69
69
{
@@ -92,7 +92,6 @@ def test_switch_database(self):
92
92
93
93
@raises (FutureWarning )
94
94
def test_switch_db_deprecated (self ):
95
- warnings .simplefilter ('error' , FutureWarning )
96
95
cli = InfluxDBClient ('host' , 8086 , 'username' , 'password' , 'database' )
97
96
cli .switch_db ('another_database' )
98
97
assert cli ._database == 'another_database'
@@ -170,7 +169,7 @@ def test_write_bad_precision_udp(self):
170
169
Exception ,
171
170
"InfluxDB only supports seconds precision for udp writes"
172
171
):
173
- cli .write_points_with_precision (
172
+ cli .write_points (
174
173
self .dummy_points ,
175
174
time_precision = 'ms'
176
175
)
@@ -184,15 +183,15 @@ def test_write_points_fails(self):
184
183
def test_write_points_with_precision (self ):
185
184
with _mocked_session ('post' , 200 , self .dummy_points ):
186
185
cli = InfluxDBClient ('host' , 8086 , 'username' , 'password' , 'db' )
187
- assert cli .write_points_with_precision (self .dummy_points ) is True
186
+ assert cli .write_points (self .dummy_points ) is True
188
187
189
188
def test_write_points_bad_precision (self ):
190
189
cli = InfluxDBClient ()
191
190
with self .assertRaisesRegexp (
192
191
Exception ,
193
192
"Invalid time precision is given. \(use 's', 'm', 'ms' or 'u'\)"
194
193
):
195
- cli .write_points_with_precision (
194
+ cli .write_points (
196
195
self .dummy_points ,
197
196
time_precision = 'g'
198
197
)
@@ -325,7 +324,7 @@ def test_get_list_database(self):
325
324
]
326
325
with _mocked_session ('get' , 200 , data ):
327
326
cli = InfluxDBClient ('host' , 8086 , 'username' , 'password' )
328
- assert len (cli .get_database_list ()) == 1
327
+ assert len (cli .get_list_database ()) == 1
329
328
assert cli .get_list_database ()[0 ]['name' ] == 'a_db'
330
329
331
330
@raises (Exception )
@@ -336,7 +335,6 @@ def test_get_list_database_fails(self):
336
335
337
336
@raises (FutureWarning )
338
337
def test_get_database_list_deprecated (self ):
339
- warnings .simplefilter ('error' , FutureWarning )
340
338
data = [
341
339
{"name" : "a_db" }
342
340
]
0 commit comments