1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

Fix httplib2 tests

This commit is contained in:
Jair Henrique
2021-11-02 21:11:12 -03:00
parent 7592efb8d9
commit 3c7b791783

View File

@@ -61,13 +61,14 @@ def test_response_headers(tmpdir, httpbin_both):
assert set(headers) == set(resp.items())
def test_effective_url(tmpdir, httpbin_both):
def test_effective_url(tmpdir):
"""Ensure that the effective_url is captured"""
url = httpbin_both.url + "/redirect-to?url=/html"
url = "http://mockbin.org/redirect/301"
with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
resp, _ = http().request(url)
effective_url = resp["content-location"]
assert effective_url == httpbin_both + "/html"
assert effective_url == "http://mockbin.org/redirect/301/0"
with vcr.use_cassette(str(tmpdir.join("headers.yaml"))):
resp, _ = http().request(url)