mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
test_aiohttp.py: Cover filter_query_parameters with aiohttp
This commit is contained in:
@@ -440,3 +440,19 @@ def test_not_allow_redirects(tmpdir, mockbin):
|
|||||||
assert response.url.path == "/redirect/308/5"
|
assert response.url.path == "/redirect/308/5"
|
||||||
assert response.status == 308
|
assert response.status == 308
|
||||||
assert cassette.play_count == 1
|
assert cassette.play_count == 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_filter_query_parameters(tmpdir, httpbin):
|
||||||
|
url = httpbin + "?password=secret"
|
||||||
|
path = str(tmpdir.join("query_param_filter.yaml"))
|
||||||
|
|
||||||
|
with vcr.use_cassette(path, filter_query_parameters=["password"]) as cassette:
|
||||||
|
get(url)
|
||||||
|
|
||||||
|
assert "password" not in cassette.requests[0].url
|
||||||
|
assert "secret" not in cassette.requests[0].url
|
||||||
|
|
||||||
|
with open(path) as f:
|
||||||
|
cassette_content = f.read()
|
||||||
|
assert "password" not in cassette_content
|
||||||
|
assert "secret" not in cassette_content
|
||||||
|
|||||||
Reference in New Issue
Block a user