diff options
Diffstat (limited to 'tests/functional/api')
-rw-r--r-- | tests/functional/api/test_gitlab.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/functional/api/test_gitlab.py b/tests/functional/api/test_gitlab.py index ced77c2..bde64d3 100644 --- a/tests/functional/api/test_gitlab.py +++ b/tests/functional/api/test_gitlab.py @@ -2,6 +2,7 @@ import pytest import requests import gitlab +from gitlab.oauth import PasswordCredentials @pytest.fixture( @@ -22,6 +23,13 @@ def test_auth_from_config(gl, gitlab_config, temp_dir): assert isinstance(test_gitlab.user, gitlab.v4.objects.CurrentUser) +def test_auth_with_ropc_flow(gl, temp_dir): + oauth_credentials = PasswordCredentials("root", "5iveL!fe") + test_gitlab = gitlab.Gitlab(gl.url, oauth_credentials=oauth_credentials) + test_gitlab.auth() + assert isinstance(test_gitlab.user, gitlab.v4.objects.CurrentUser) + + def test_no_custom_session(gl, temp_dir): """Test no custom session""" custom_session = requests.Session() |