1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

Fix before_record_reponse doc

This commit is contained in:
Thomas Grainger
2015-07-16 15:13:19 +01:00
parent bb05b2fcf7
commit 025a3b422d

View File

@@ -419,10 +419,10 @@ that of ``before_record``:
def scrub_string(string, replacement=''): def scrub_string(string, replacement=''):
def before_record_reponse(response): def before_record_reponse(response):
return response['body']['string'] = response['body']['string'].replace(string, replacement) return response['body']['string'] = response['body']['string'].replace(string, replacement)
return scrub_string return before_record_reponse
my_vcr = vcr.VCR( my_vcr = vcr.VCR(
before_record=scrub_string(settings.USERNAME, 'username'), before_record_reponse=scrub_string(settings.USERNAME, 'username'),
) )
with my_vcr.use_cassette('test.yml'): with my_vcr.use_cassette('test.yml'):
# your http code here # your http code here