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

Commit32844c7

Browse files
committed
test: add unit tests for base URLs with trailing slashes
1 parente8f0921 commit32844c7

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎gitlab/tests/test_gitlab.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,23 @@ def resp_cont(url, request):
376376
self.assertRaises(GitlabHttpError,self.gl.http_delete,"/not_there")
377377

378378

379+
classTestGitlabStripBaseUrl(unittest.TestCase):
380+
defsetUp(self):
381+
self.gl=Gitlab(
382+
"http://localhost/",private_token="private_token",api_version=4
383+
)
384+
385+
deftest_strip_base_url(self):
386+
self.assertEqual(self.gl.url,"http://localhost")
387+
388+
deftest_strip_api_url(self):
389+
self.assertEqual(self.gl.api_url,"http://localhost/api/v4")
390+
391+
deftest_build_url(self):
392+
r=self.gl._build_url("/projects")
393+
self.assertEqual(r,"http://localhost/api/v4/projects")
394+
395+
379396
classTestGitlabAuth(unittest.TestCase):
380397
deftest_invalid_auth_args(self):
381398
self.assertRaises(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp