Skip to content

Commit

Permalink
Split up requests and urllib3 unit tests.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Oct 23, 2023
1 parent df5b29b commit 8d5aeb0
Show file tree
Hide file tree
Showing 6 changed files with 1,179 additions and 1,237 deletions.
8 changes: 2 additions & 6 deletions test_opensearchpy/test_async/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@
pytestmark = pytest.mark.asyncio


def gzip_decompress(data):
buf = gzip.GzipFile(fileobj=io.BytesIO(data), mode="rb")
return buf.read()


class TestAIOHttpConnection:
async def _get_mock_connection(
self,
Expand Down Expand Up @@ -130,7 +125,8 @@ async def test_http_compression(self):

_, kwargs = con.session.request.call_args

assert gzip_decompress(kwargs["data"]) == b"{}"
buf = gzip.GzipFile(fileobj=io.BytesIO(kwargs["data"]), mode="rb")
assert buf.read() == b"{}"
assert kwargs["headers"]["accept-encoding"] == "gzip,deflate"
assert kwargs["headers"]["content-encoding"] == "gzip"

Expand Down
Loading

0 comments on commit 8d5aeb0

Please sign in to comment.