summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook.git@proton.me>2023-05-15 13:15:07 -0500
committerJordan Cook <jordan.cook.git@proton.me>2023-05-15 14:43:18 -0500
commitff2f693e0c6f0f6112ac8b158bdc9b1926a66b4a (patch)
tree4eafec3191f8d4b80814dae94e833052d21cf2e7 /tests
parent6a59bfd6273112e9aca59e9588fd71edbafb8df3 (diff)
downloadrequests-cache-ff2f693e0c6f0f6112ac8b158bdc9b1926a66b4a.tar.gz
Add compatibility with urllib3 2.0
Diffstat (limited to 'tests')
-rw-r--r--tests/integration/base_cache_test.py13
-rw-r--r--tests/unit/models/test_raw_response.py1
2 files changed, 4 insertions, 10 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])
diff --git a/tests/unit/models/test_raw_response.py b/tests/unit/models/test_raw_response.py
index 9ec1591..ea80e57 100644
--- a/tests/unit/models/test_raw_response.py
+++ b/tests/unit/models/test_raw_response.py
@@ -16,7 +16,6 @@ def test_from_response(mock_session):
if hasattr(response.raw, '_request_url'):
assert response.raw._request_url is raw.request_url is None
assert response.raw.status == raw.status == 200
- assert response.raw.strict == raw.strict == 0
assert response.raw.version == raw.version == 0