Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a0779ab

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

File tree

1 file changed

+9
-6
lines changed
Filter options

1 file changed

+9
-6
lines changed

‎tests/test_WriteApi.py

Copy file name to clipboardExpand all lines: tests/test_WriteApi.py
+9-6Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.