Skip to content

Commit a0779ab

Browse files
committed
fix(tests): new version of InfluxDB allows empty writes - influxdata/influxdb#22575
1 parent 96d99de commit a0779ab

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/test_WriteApi.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,15 @@ def test_use_default_org(self):
338338
def test_write_empty_data(self):
339339
bucket = self.create_test_bucket()
340340

341-
with self.assertRaises(ApiException) as cm:
342-
self.write_client.write(bucket.name, record="")
343-
exception = cm.exception
344-
345-
self.assertEqual(400, exception.status)
346-
self.assertEqual("Bad Request", exception.reason)
341+
from distutils.version import LooseVersion
342+
version = self.client.health().version
343+
if version != 'nightly' and LooseVersion(version) <= LooseVersion("2.0.8"):
344+
with self.assertRaises(ApiException) as cm:
345+
self.write_client.write(bucket.name, record="")
346+
exception = cm.exception
347+
348+
self.assertEqual(400, exception.status)
349+
self.assertEqual("Bad Request", exception.reason)
347350

348351
result = self.query_api.query(
349352
"from(bucket:\"" + bucket.name + "\") |> range(start: 1970-01-01T00:00:00.000000001Z) |> last()", self.org)

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