]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
add test for redirects
authorKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 01:05:19 +0000 (15:05 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 01:05:42 +0000 (15:05 -1000)
tests/integration/test_request.py [new file with mode: 0644]

diff --git a/tests/integration/test_request.py b/tests/integration/test_request.py
new file mode 100644 (file)
index 0000000..9fdc84a
--- /dev/null
@@ -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