]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
move wild into its own folder
authorKevin McCarthy <me@kevinmccarthy.org>
Sun, 11 Aug 2013 03:09:09 +0000 (17:09 -1000)
committerKevin McCarthy <me@kevinmccarthy.org>
Mon, 12 Aug 2013 01:05:42 +0000 (15:05 -1000)
tests/integration/test_wild.py [new file with mode: 0644]

diff --git a/tests/integration/test_wild.py b/tests/integration/test_wild.py
new file mode 100644 (file)
index 0000000..a4fe46a
--- /dev/null
@@ -0,0 +1,17 @@
+import pytest
+requests = pytest.importorskip("requests")
+
+import vcr
+
+def test_domain_redirect():
+    '''Ensure that redirects across domains are considered unique'''
+    # In this example, seomoz.org redirects to moz.com, and if those
+    # requests are considered identical, then we'll be stuck in a redirect
+    # loop.
+    url = 'http://seomoz.org/'
+    with vcr.use_cassette('domain_redirect.yaml') as cass:
+        requests.get(url, headers={'User-Agent': 'vcrpy-test'})
+        # Ensure that we've now served two responses. One for the original
+        # redirect, and a second for the actual fetch
+        assert len(cass) == 2
+