File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -323,6 +323,35 @@ def test_version(self):
323
323
version = self .client .version ()
324
324
self .assertTrue (len (version ) > 0 )
325
325
326
+ def test_url_attribute (self ):
327
+ # Wrong URL attribute
328
+ wrong_types = [
329
+ None ,
330
+ True , False ,
331
+ 123 , 123.5 ,
332
+ dict ({"url" : "http://localhost:8086" }),
333
+ list (["http://localhost:8086" ]),
334
+ tuple (("http://localhost:8086" ))
335
+ ]
336
+ correct_types = [
337
+ "http://localhost:8086"
338
+ ]
339
+ for url_type in wrong_types :
340
+ try :
341
+ client_not_running = InfluxDBClient (url = url_type , token = "my-token" , debug = True )
342
+ status = True
343
+ except ValueError as e :
344
+ status = False
345
+ self .assertFalse (status )
346
+ for url_type in correct_types :
347
+ try :
348
+ client_not_running = InfluxDBClient (url = url_type , token = "my-token" , debug = True )
349
+ status = True
350
+ except ValueError as e :
351
+ status = False
352
+ self .assertTrue (status )
353
+
354
+
326
355
def test_build (self ):
327
356
build = self .client .build ()
328
357
self .assertEqual ('oss' , build .lower ())
You can’t perform that action at this time.
0 commit comments