]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
unzip bodies before comparing. Fixes #261
authorKevin McCarthy <me@kevinmccarthy.org>
Sun, 3 Jul 2016 21:58:01 +0000 (11:58 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 4 Jul 2016 03:27:52 +0000 (17:27 -1000)
tests/integration/test_stubs.py

index b0607c212ce0f79efeb97ac8a0aa3fa680d08f74..71c7f3b989c52f82e994906e2f00934935077ec3 100644 (file)
@@ -1,4 +1,5 @@
 import vcr
+import zlib
 import six.moves.http_client as httplib
 
 from assertions import assert_is_json
@@ -69,7 +70,9 @@ def test_original_decoded_response_is_not_modified(tmpdir, httpbin):
         inside_headers = (h for h in inside.headers.items() if h[0] != 'Date')
         outside_headers = (h for h in outside.getheaders() if h[0] != 'Date')
         assert set(inside_headers) == set(outside_headers)
-        assert inside.read() == outside.read()
+        inside = zlib.decompress(inside.read(), 16+zlib.MAX_WBITS)
+        outside = zlib.decompress(outside.read(), 16+zlib.MAX_WBITS)
+        assert inside == outside
 
     # Even though the above are raw bytes, the JSON data should have been
     # decoded and saved to the cassette.