From: Danilo Shiga Date: Tue, 18 Sep 2018 13:11:33 +0000 (-0300) Subject: Improve test_use_proxy with cassette headers and play_count assertion X-Git-Tag: v2.0.0~5^2~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=957db22d5c50b560b923184da04e06b63afb5f60;p=vcrpy.git Improve test_use_proxy with cassette headers and play_count assertion --- diff --git a/tests/integration/test_proxy.py b/tests/integration/test_proxy.py index 5dfd285..4dfcb92 100644 --- a/tests/integration/test_proxy.py +++ b/tests/integration/test_proxy.py @@ -51,5 +51,10 @@ def proxy_server(): def test_use_proxy(tmpdir, httpbin, proxy_server): '''Ensure that it works with a proxy.''' with vcr.use_cassette(str(tmpdir.join('proxy.yaml'))): - requests.get(httpbin.url, proxies={'http': proxy_server}) - requests.get(httpbin.url, proxies={'http': proxy_server}) + response, _ = requests.get(httpbin.url, proxies={'http': proxy_server}) + + with vcr.use_cassette(str(tmpdir.join('proxy.yaml'))) as cassette: + cassette_response, _ = requests.get(httpbin.url, proxies={'http': proxy_server}) + + assert cassette_response.headers == response.headers + assert cassette.play_count == 1