We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a21b25a commit 1b410f6Copy full SHA for 1b410f6
tests/test_WriteApi.py
@@ -370,6 +370,19 @@ def test_write_list_of_list_point_with_default_tags(self):
370
self.assertEqual(self.customer_tag, record["customer"])
371
self.assertEqual("LA", record[self.data_center_key])
372
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
386
387
class AsynchronousWriteTest(BaseTest):
388
0 commit comments