mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
simplified logic so that either params or url is used, if params are specified - they will overwrite any get params on the url
This commit is contained in:
committed by
Luiz Menezes
parent
1674741d9f
commit
0d4c9eccf5
@@ -51,11 +51,14 @@ def vcr_request(cassette, real_request):
|
||||
headers = self._prepare_headers(headers)
|
||||
data = kwargs.get('data')
|
||||
params = kwargs.get('params')
|
||||
|
||||
if params:
|
||||
for k, v in params.items():
|
||||
params[k] = str(v)
|
||||
|
||||
request_url = URL(url).with_query(params)
|
||||
else:
|
||||
request_url = URL(url)
|
||||
|
||||
vcr_request = Request(method, str(request_url), data, headers)
|
||||
|
||||
if cassette.can_play_response_for(vcr_request):
|
||||
|
||||
Reference in New Issue
Block a user