mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
Updated comments
This commit is contained in:
@@ -66,8 +66,8 @@ def test_original_decoded_response_is_not_modified(tmpdir, httpbin):
|
|||||||
assert inside.headers.items() == outside.headers.items()
|
assert inside.headers.items() == outside.headers.items()
|
||||||
assert inside.read() == outside.read()
|
assert inside.read() == outside.read()
|
||||||
|
|
||||||
# Even though the above are raw bytes, the JSON data should have be decoded
|
# Even though the above are raw bytes, the JSON data should have been
|
||||||
# and saved to the cassette.
|
# decoded and saved to the cassette.
|
||||||
with vcr.use_cassette(testfile) as cass:
|
with vcr.use_cassette(testfile) as cass:
|
||||||
inside2 = urlopen(request)
|
inside2 = urlopen(request)
|
||||||
assert 'content-encoding' not in inside2.headers
|
assert 'content-encoding' not in inside2.headers
|
||||||
|
|||||||
@@ -146,8 +146,8 @@ def decode_response(response):
|
|||||||
else: # encoding == 'deflate'
|
else: # encoding == 'deflate'
|
||||||
return zlib.decompress(body)
|
return zlib.decompress(body)
|
||||||
|
|
||||||
# Deepcopy here in case headers contain lists and other objects that could
|
# Deepcopy here in case `headers` contain objects that could
|
||||||
# be mutated by a shallow copy.
|
# be mutated by a shallow copy and corrupt the real response.
|
||||||
response = copy.deepcopy(response)
|
response = copy.deepcopy(response)
|
||||||
headers = CaseInsensitiveDict(response['headers'])
|
headers = CaseInsensitiveDict(response['headers'])
|
||||||
if is_compressed(headers):
|
if is_compressed(headers):
|
||||||
|
|||||||
Reference in New Issue
Block a user