diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-10 17:35:34 +0100 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-10 17:35:34 +0100 |
commit | 8fec612157e4c15f587c11efc98e7e339dfcff28 (patch) | |
tree | b1b9452bfce982003324fca9fc92ecbc9c085770 /tools/python_test_v4.py | |
parent | 700e84f3ea1a8e0f99775d02cd1a832d05d3ec8d (diff) | |
download | gitlab-8fec612157e4c15f587c11efc98e7e339dfcff28.tar.gz |
Add support for impersonation tokens API
Closes #363
Diffstat (limited to 'tools/python_test_v4.py')
-rw-r--r-- | tools/python_test_v4.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py index fa83228..7d769f3 100644 --- a/tools/python_test_v4.py +++ b/tools/python_test_v4.py @@ -145,6 +145,17 @@ assert(len(new_user.customattributes.list()) == 1) attr.delete() assert(len(new_user.customattributes.list()) == 0) +# impersonation tokens +user_token = new_user.impersonationtokens.create( + {'name': 'token1', 'scopes': ['api', 'read_user']}) +l = new_user.impersonationtokens.list(state='active') +assert(len(l) == 1) +user_token.delete() +l = new_user.impersonationtokens.list(state='active') +assert(len(l) == 0) +l = new_user.impersonationtokens.list(state='inactive') +assert(len(l) == 1) + new_user.delete() foobar_user.delete() assert(len(gl.users.list()) == 3) @@ -485,7 +496,7 @@ except gitlab.GitlabMRClosedError: p_b = admin_project.protectedbranches.create({'name': '*-stable'}) assert(p_b.name == '*-stable') p_b = admin_project.protectedbranches.get('*-stable') -# master is protected by default +# master is protected by default when a branch has been created assert(len(admin_project.protectedbranches.list()) == 2) admin_project.protectedbranches.delete('master') p_b.delete() |