|
8 | 8 | import pytest |
9 | 9 | from aioresponses import aioresponses |
10 | 10 |
|
11 | | -from influxdb_client import Point, WritePrecision, BucketsService |
| 11 | +from influxdb_client import Point, WritePrecision, BucketsService, OrganizationsService, Organizations |
12 | 12 | from influxdb_client.client.exceptions import InfluxDBError |
13 | 13 | from influxdb_client.client.influxdb_client_async import InfluxDBClientAsync |
14 | 14 | from influxdb_client.client.query_api import QueryOptions |
@@ -329,7 +329,7 @@ async def test_query_and_debug(self): |
329 | 329 | self.assertIn("my-bucket", results) |
330 | 330 | # Bucket API |
331 | 331 | buckets_service = BucketsService(api_client=self.client.api_client) |
332 | | - results = await buckets_service.get_buckets() |
| 332 | + results = await buckets_service.get_buckets_async() |
333 | 333 | self.assertIn("my-bucket", list(map(lambda bucket: bucket.name, results.buckets))) |
334 | 334 |
|
335 | 335 | @async_test |
@@ -402,6 +402,13 @@ async def test_parse_utf8_two_bytes_character(self, mocked): |
402 | 402 | data_frame = await self.client.query_api().query_data_frame("from()", "my-org") |
403 | 403 | self.assertEqual(1000, len(data_frame)) |
404 | 404 |
|
| 405 | + @async_test |
| 406 | + async def test_management_apis(self): |
| 407 | + service = OrganizationsService(api_client=self.client.api_client) |
| 408 | + results = await service.get_orgs_async() |
| 409 | + self.assertIsInstance(results, Organizations) |
| 410 | + self.assertIn("my-org", list(map(lambda org: org.name, results.orgs))) |
| 411 | + |
405 | 412 | async def _prepare_data(self, measurement: str): |
406 | 413 | _point1 = Point(measurement).tag("location", "Prague").field("temperature", 25.3) |
407 | 414 | _point2 = Point(measurement).tag("location", "New York").field("temperature", 24.3) |
|
0 commit comments