assert inside.headers.items() == outside.headers.items()
assert inside.read() == outside.read()
- # Even though the above are raw bytes, the JSON data should have be decoded
- # and saved to the cassette.
+ # Even though the above are raw bytes, the JSON data should have been
+ # decoded and saved to the cassette.
with vcr.use_cassette(testfile) as cass:
inside2 = urlopen(request)
assert 'content-encoding' not in inside2.headers
else: # encoding == 'deflate'
return zlib.decompress(body)
- # Deepcopy here in case headers contain lists and other objects that could
- # be mutated by a shallow copy.
+ # Deepcopy here in case `headers` contain objects that could
+ # be mutated by a shallow copy and corrupt the real response.
response = copy.deepcopy(response)
headers = CaseInsensitiveDict(response['headers'])
if is_compressed(headers):