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

Commit896938f

Browse files
committed
test: add test case for keeping base url same in next url
1 parent26a9069 commit896938f

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
@@ -353,3 +353,37 @@ def test_gitlab_plain_const_does_not_warn(recwarn):
353353

354354
assertnotrecwarn
355355
assertno_access==0
356+
357+
358+
@responses.activate
359+
deftest_gitlab_keep_base_url(gl):
360+
responses.add(
361+
**{
362+
"method":responses.GET,
363+
"url":"http://localhost/api/v4/tests",
364+
"json": [{"a":"b"}],
365+
"headers": {
366+
"X-Page":"1",
367+
"X-Next-Page":"2",
368+
"X-Per-Page":"1",
369+
"X-Total-Pages":"2",
370+
"X-Total":"2",
371+
"Link": (
372+
"<http://orig_host/api/v4/tests?per_page=1&page=2>;"' rel="next"'
373+
),
374+
},
375+
"content_type":"application/json",
376+
"status":200,
377+
"match":helpers.MATCH_EMPTY_QUERY_PARAMS,
378+
}
379+
)
380+
381+
obj=gl.http_list("/tests",iterator=True)
382+
assertlen(obj)==2
383+
assertobj._next_url=="http://localhost/api/v4/tests?per_page=1&page=2"
384+
assertobj.current_page==1
385+
assertobj.prev_pageisNone
386+
assertobj.next_page==2
387+
assertobj.per_page==1
388+
assertobj.total_pages==2
389+
assertobj.total==2

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp