diff options
author | Jordan Cook <jordan.cook.git@proton.me> | 2023-05-15 14:48:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 14:48:09 -0500 |
commit | 68760791753c0b7892a669028b3b7658eb80220b (patch) | |
tree | 4eafec3191f8d4b80814dae94e833052d21cf2e7 /tests/integration/base_cache_test.py | |
parent | 6a59bfd6273112e9aca59e9588fd71edbafb8df3 (diff) | |
parent | ff2f693e0c6f0f6112ac8b158bdc9b1926a66b4a (diff) | |
download | requests-cache-main.tar.gz |
Add compatibility with urllib3 2.0
Diffstat (limited to 'tests/integration/base_cache_test.py')
-rw-r--r-- | tests/integration/base_cache_test.py | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/integration/base_cache_test.py b/tests/integration/base_cache_test.py index 3e4d230..44d45eb 100644 --- a/tests/integration/base_cache_test.py +++ b/tests/integration/base_cache_test.py @@ -261,21 +261,16 @@ class BaseCacheTest: assert response.from_cache is True assert response.is_expired is False - @pytest.mark.parametrize('stream', [True, False]) - def test_decode_gzip_response(self, stream): - """Test that gzip-compressed raw responses (including streamed responses) can be manually - decompressed with `decode_content=True` - """ + def test_decode_gzip_response(self): + """Test that gzip-compressed responses read decompressed content with decode_content=True""" session = self.init_session() - response = session.get(httpbin('gzip'), stream=stream) + response = session.get(httpbin('gzip')) assert b'gzipped' in response.content - if stream is True: - assert b'gzipped' in response.raw.read(None, decode_content=True) response.raw._fp = BytesIO(response.content) cached_response = CachedResponse.from_response(response) assert b'gzipped' in cached_response.content - assert b'gzipped' in cached_response.raw.read(None, decode_content=True) + assert b'gzipped' in cached_response.raw.read(amt=None, decode_content=True) @pytest.mark.parametrize('decode_content', [True, False]) @pytest.mark.parametrize('url', [MOCKED_URL_JSON, MOCKED_URL_JSON_LIST]) |