Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6f71c66

Browse files
committed
test(unit): reproduce duplicate encoded query params
1 parente2ea8b8 commit6f71c66

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎tests/unit/test_gitlab_http_methods.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ def test_http_request(gl):
3636
assertresponses.assert_call_count(url,1)isTrue
3737

3838

39+
@responses.activate
40+
deftest_http_request_with_url_encoded_kwargs_does_not_duplicate_params(gl):
41+
url="http://localhost/api/v4/projects?topics%5B%5D=python"
42+
responses.add(
43+
method=responses.GET,
44+
url=url,
45+
json=[{"name":"project1"}],
46+
status=200,
47+
match=[responses.matchers.query_param_matcher({"topics[]":"python"})],
48+
)
49+
50+
kwargs= {"topics[]":"python"}
51+
http_r=gl.http_request("get","/projects?topics%5B%5D=python",**kwargs)
52+
http_r.json()
53+
asserthttp_r.status_code==200
54+
assertresponses.assert_call_count(url,1)
55+
56+
3957
@responses.activate
4058
deftest_http_request_404(gl):
4159
url="http://localhost/api/v4/not_there"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp