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

Don't assume params to be a dictionary

aiohttp also fails with pass parameter values with types other than
string, integer or float.
This commit is contained in:
Andre Ambrosio Boechat
2022-05-03 13:18:22 -03:00
committed by Jair Henrique
parent b1bc5c3a02
commit 7add8c0bab
2 changed files with 2 additions and 4 deletions

View File

@@ -154,7 +154,7 @@ def test_post(tmpdir, scheme, body, caplog):
def test_params(tmpdir, scheme):
url = scheme + "://httpbin.org/get"
headers = {"Content-Type": "application/json"}
params = {"a": 1, "b": False, "c": "c"}
params = {"a": 1, "b": 2, "c": "c"}
with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
_, response_json = get(url, output="json", params=params, headers=headers)
@@ -168,7 +168,7 @@ def test_params(tmpdir, scheme):
def test_params_same_url_distinct_params(tmpdir, scheme):
url = scheme + "://httpbin.org/get"
headers = {"Content-Type": "application/json"}
params = {"a": 1, "b": False, "c": "c"}
params = {"a": 1, "b": 2, "c": "c"}
with vcr.use_cassette(str(tmpdir.join("get.yaml"))) as cassette:
_, response_json = get(url, output="json", params=params, headers=headers)

View File

@@ -244,8 +244,6 @@ def vcr_request(cassette, real_request):
request_url = URL(url)
if params:
for k, v in params.items():
params[k] = str(v)
request_url = URL(url).with_query(params)
c_header = headers.pop(hdrs.COOKIE, None)