Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Fixed gzip tests by comparing decompressed values #854

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions influxdb/tests/client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down
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