Skip to content

Commit 1b410f6

Browse files
committed
test: removed last() - see influxdata/influxdb#18897
1 parent a21b25a commit 1b410f6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_WriteApi.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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

374387
class AsynchronousWriteTest(BaseTest):
375388

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy