diff --git a/influxdb/tests/client_test.py b/influxdb/tests/client_test.py index e511ca9b..7f1091cb 100644 --- a/influxdb/tests/client_test.py +++ b/influxdb/tests/client_test.py @@ -246,10 +246,11 @@ def test_write_gzip(self): b"cpu_load_short,host=server01,region=us-west " b"value=0.64 1257894000000000000\n" ) + compressed.seek(0) self.assertEqual( - m.last_request.body, - compressed.getvalue(), + gzip.GzipFile(fileobj=io.BytesIO(m.last_request.body)).read(), + gzip.GzipFile(fileobj=compressed).read() ) def test_write_points_gzip(self): @@ -276,9 +277,11 @@ def test_write_points_gzip(self): b'cpu_load_short,host=server01,region=us-west ' b'value=0.64 1257894000123456000\n' ) + compressed.seek(0) + self.assertEqual( - m.last_request.body, - compressed.getvalue(), + gzip.GzipFile(fileobj=io.BytesIO(m.last_request.body)).read(), + gzip.GzipFile(fileobj=compressed).read() ) def test_write_points_toplevel_attributes(self):