mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-10 09:35:34 +00:00
Update test to ensure that filter is correctly applied
This commit is contained in:
@@ -224,9 +224,13 @@ def test_filter_post_params(tmpdir, scheme):
|
|||||||
This tests the issue in https://github.com/kevin1024/vcrpy/issues/158
|
This tests the issue in https://github.com/kevin1024/vcrpy/issues/158
|
||||||
|
|
||||||
Ensure that a post request made through requests can still be filtered.
|
Ensure that a post request made through requests can still be filtered.
|
||||||
|
with vcr.use_cassette(cass_file, filter_post_data_parameters=['id']) as cass:
|
||||||
|
assert b'id=secret' not in cass.requests[0].body
|
||||||
'''
|
'''
|
||||||
url = scheme + '://httpbin.org/post'
|
url = scheme + '://httpbin.org/post'
|
||||||
cass_loc = str(tmpdir.join('filter_post_params.yaml'))
|
cass_loc = str(tmpdir.join('filter_post_params.yaml'))
|
||||||
with vcr.use_cassette(cass_loc, filter_post_data_parameters=['key']) as cass:
|
with vcr.use_cassette(cass_loc, filter_post_data_parameters=['key']) as cass:
|
||||||
requests.post(url, data={'key': 'value'})
|
requests.post(url, data={'key': 'value'})
|
||||||
|
with vcr.use_cassette(cass_loc, filter_post_data_parameters=['key']) as cass:
|
||||||
|
assert b'key=value' not in cass.requests[0].body
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user