]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
fix tests in stubs, requests ssl verification and httpbin+flask
authorbogdan barna <foo.barna@gmail.com>
Fri, 24 Jun 2016 08:43:01 +0000 (11:43 +0300)
committerbogdan barna <foo.barna@gmail.com>
Fri, 24 Jun 2016 08:43:01 +0000 (11:43 +0300)
tests/integration/test_stubs.py
tests/integration/test_wild.py
tox.ini

index 745d64b692eca008ab1e51c02633e11f7a4b3013..b0607c212ce0f79efeb97ac8a0aa3fa680d08f74 100644 (file)
@@ -66,7 +66,9 @@ def test_original_decoded_response_is_not_modified(tmpdir, httpbin):
         assert 'gzip' == inside.headers['content-encoding']
 
         # They should effectively be the same response.
-        assert inside.headers.items() == outside.getheaders()
+        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()
 
     # Even though the above are raw bytes, the JSON data should have been
index 9b694565438c4a1368e155f6401a5ec16148fbd4..a0a5a9a98787905ea0ef5286af4897e32bf44474 100644 (file)
@@ -76,7 +76,7 @@ def test_amazon_doctype(tmpdir):
     # amazon gzips its homepage.  For some reason, in requests 2.7, it's not
     # getting gunzipped.
     with vcr.use_cassette(str(tmpdir.join('amz.yml'))):
-        r = requests.get('http://www.amazon.com')
+        r = requests.get('http://www.amazon.com', verify=False)
     assert 'html' in r.text
 
 
diff --git a/tox.ini b/tox.ini
index 56522bc70e5ef52d617ca9047bd37c3c119f0bc1..046a848e7739f7a20e8b814f4a3fade7c72de91c 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -13,6 +13,8 @@ deps = flake8
 commands =
     ./runtests.sh {posargs}
 deps =
+    # httpbin fails with latest Flask, so we pin it
+    Flask==0.10.1
     mock
     pytest
     pytest-httpbin