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

Commitc815b94

Browse files
iomarmochtarJohnVillalovos
authored andcommitted
test: add test case for keeping base url same in next url
1 parentd3d662f commitc815b94

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

‎tests/unit/test_gitlab.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,37 @@ def test_gitlab_plain_const_does_not_warn(recwarn):
342342

343343
assertnotrecwarn
344344
assertno_access==0
345+
346+
347+
@responses.activate
348+
deftest_gitlab_keep_base_url(gl):
349+
responses.add(
350+
**{
351+
"method":responses.GET,
352+
"url":"http://localhost/api/v4/tests",
353+
"json": [{"a":"b"}],
354+
"headers": {
355+
"X-Page":"1",
356+
"X-Next-Page":"2",
357+
"X-Per-Page":"1",
358+
"X-Total-Pages":"2",
359+
"X-Total":"2",
360+
"Link": (
361+
"<http://orig_host/api/v4/tests?per_page=1&page=2>;"' rel="next"'
362+
),
363+
},
364+
"content_type":"application/json",
365+
"status":200,
366+
"match":helpers.MATCH_EMPTY_QUERY_PARAMS,
367+
}
368+
)
369+
370+
obj=gl.http_list("/tests",iterator=True)
371+
assertlen(obj)==2
372+
assertobj._next_url=="http://localhost/api/v4/tests?per_page=1&page=2"
373+
assertobj.current_page==1
374+
assertobj.prev_pageisNone
375+
assertobj.next_page==2
376+
assertobj.per_page==1
377+
assertobj.total_pages==2
378+
assertobj.total==2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp