File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -370,6 +370,19 @@ def test_write_list_of_list_point_with_default_tags(self):
370370 self .assertEqual (self .customer_tag , record ["customer" ])
371371 self .assertEqual ("LA" , record [self .data_center_key ])
372372
373+ def test_check_write_permission_by_empty_data (self ):
374+ client = InfluxDBClient (url = "http://localhost:9999" , token = "my-token-wrong" , org = "my-org" )
375+ write_api = client .write_api (write_options = SYNCHRONOUS )
376+
377+ with self .assertRaises (ApiException ) as cm :
378+ write_api .write ("my-bucket" , self .org , b'' )
379+ exception = cm .exception
380+
381+ self .assertEqual (401 , exception .status )
382+ self .assertEqual ("Unauthorized" , exception .reason )
383+
384+ client .__del__ ()
385+
373386
374387class AsynchronousWriteTest (BaseTest ):
375388
You can’t perform that action at this time.
0 commit comments