Skip to content

Commit

Permalink
fix(tests): new version of InfluxDB allows empty writes - influxdata/…
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Oct 4, 2021
1 parent 96d99de commit a0779ab
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/test_WriteApi.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,15 @@ def test_use_default_org(self):
def test_write_empty_data(self):
bucket = self.create_test_bucket()

with self.assertRaises(ApiException) as cm:
self.write_client.write(bucket.name, record="")
exception = cm.exception

self.assertEqual(400, exception.status)
self.assertEqual("Bad Request", exception.reason)
from distutils.version import LooseVersion
version = self.client.health().version
if version != 'nightly' and LooseVersion(version) <= LooseVersion("2.0.8"):
with self.assertRaises(ApiException) as cm:
self.write_client.write(bucket.name, record="")
exception = cm.exception

self.assertEqual(400, exception.status)
self.assertEqual("Bad Request", exception.reason)

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

0 comments on commit a0779ab

Please sign in to comment.