Skip to content

Commit f8cf1e1

Browse files
committed
chore: add test
1 parent 9ef8311 commit f8cf1e1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

gitlab/tests/test_config.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
[four]
5252
url = https://four.url
5353
oauth_token = STUV
54+
55+
[five]
56+
url = https://five.url
57+
oauth_token = lookup: echo "foobar"
5458
"""
5559

5660
custom_user_agent_config = """[global]
@@ -192,6 +196,13 @@ def test_valid_data(m_open, path_exists):
192196
assert 2 == cp.timeout
193197
assert True == cp.ssl_verify
194198

199+
cp = config.GitlabConfigParser(gitlab_id="five")
200+
assert "five" == cp.gitlab_id
201+
assert "https://five.url" == cp.url
202+
assert None == cp.private_token
203+
assert "foobar" == cp.oauth_token
204+
assert 2 == cp.timeout
205+
assert True == cp.ssl_verify
195206

196207
@mock.patch("os.path.exists")
197208
@mock.patch("builtins.open")

0 commit comments

Comments
 (0)