summaryrefslogtreecommitdiff
path: root/gitlab/tests
diff options
context:
space:
mode:
authorMax Wittig <max.wittig@siemens.com>2020-02-24 13:46:45 +0100
committerGitHub <noreply@github.com>2020-02-24 13:46:45 +0100
commit292dfff5050515d07b2e4f2231e2ec17dc2d5589 (patch)
treed350f4644b4c40caad5d91ec2e76410ee3828d7d /gitlab/tests
parente8f0921d164c4b7db78e2f62e75eb32094b4456e (diff)
parent2e396e4a84690c2ea2ea7035148b1a6038c03301 (diff)
downloadgitlab-292dfff5050515d07b2e4f2231e2ec17dc2d5589.tar.gz
Merge pull request #1027 from nejch/fix/base-url-trailing-slash
Fix: remove trailing slash in base URL
Diffstat (limited to 'gitlab/tests')
-rw-r--r--gitlab/tests/test_gitlab.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/gitlab/tests/test_gitlab.py b/gitlab/tests/test_gitlab.py
index b56889a..b5c0ed5 100644
--- a/gitlab/tests/test_gitlab.py
+++ b/gitlab/tests/test_gitlab.py
@@ -376,6 +376,23 @@ class TestGitlabHttpMethods(unittest.TestCase):
self.assertRaises(GitlabHttpError, self.gl.http_delete, "/not_there")
+class TestGitlabStripBaseUrl(unittest.TestCase):
+ def setUp(self):
+ self.gl = Gitlab(
+ "http://localhost/", private_token="private_token", api_version=4
+ )
+
+ def test_strip_base_url(self):
+ self.assertEqual(self.gl.url, "http://localhost")
+
+ def test_strip_api_url(self):
+ self.assertEqual(self.gl.api_url, "http://localhost/api/v4")
+
+ def test_build_url(self):
+ r = self.gl._build_url("/projects")
+ self.assertEqual(r, "http://localhost/api/v4/projects")
+
+
class TestGitlabAuth(unittest.TestCase):
def test_invalid_auth_args(self):
self.assertRaises(