From 348cc8fdfe17db8f5eb2260e261804622b99a348 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Sun, 18 Aug 2013 12:04:22 -1000 Subject: [PATCH] Fix Google test Failure Let's not use Google to test redirects since it changes depending on your geographic location. I changed the test to use httpbin.org, since a lot of our tests already depend on httpbin.org anyway. Somedays, I'd like to implement my own local mock HTTP server I can do asserts against. The test suite would just start it up, and the server would record the requests, which I could then retrieve and compare. Closes #21 --- tests/integration/test_request.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_request.py b/tests/integration/test_request.py index 1875a4d..6838532 100644 --- a/tests/integration/test_request.py +++ b/tests/integration/test_request.py @@ -4,9 +4,9 @@ import vcr def test_recorded_request_url_with_redirected_request(tmpdir): with vcr.use_cassette(str(tmpdir.join('test.yml'))) as cass: assert len(cass) == 0 - urllib2.urlopen('http://google.com') + urllib2.urlopen('http://httpbin.org/redirect/3') print cass.requests print cass.requests[0] - assert cass.requests[0].url == 'http://google.com' - assert cass.requests[1].url == 'http://www.google.com/' - assert len(cass) == 2 + assert cass.requests[0].url == 'http://httpbin.org/redirect/3' + assert cass.requests[3].url == 'http://httpbin.org/get' + assert len(cass) == 4