1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 09:13:23 +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:
Goran Stefkovski
2018-06-21 16:17:49 +10:00
committed by Luiz Menezes
parent 1674741d9f
commit 0d4c9eccf5

View File

@@ -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):