1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

add test for redirects

This commit is contained in:
Kevin McCarthy
2013-08-11 15:05:19 -10:00
parent c7abde24b8
commit ce88331ebe

View File

@@ -0,0 +1,9 @@
import urllib2
import vcr
def test_recorded_request_url_with_redirected_request(tmpdir):
with vcr.use_cassette(str(tmpdir.join('test.yml'))) as cass:
urllib2.urlopen('http://google.com')
assert cass.requests[0].url == 'http://google.com'
assert cass.requests[1].url == 'http://www.google.com/'
assert len(cass) == 2