diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-09-02 16:37:43 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-09-02 16:37:43 +0200 |
commit | c99e399443819024e2e44cbd437091a39641ae68 (patch) | |
tree | c658432a57a087494df5557f4b975ce0af05f2ee /tools/python_test_v4.py | |
parent | fcccfbda6342659ae4e040901bfd0ddaeb4541d5 (diff) | |
download | gitlab-c99e399443819024e2e44cbd437091a39641ae68.tar.gz |
Add support for protected branches
This feature appeared in gitlab 9.5.
Fixes #299
Diffstat (limited to 'tools/python_test_v4.py')
-rw-r--r-- | tools/python_test_v4.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py index 0cbea33..2113830 100644 --- a/tools/python_test_v4.py +++ b/tools/python_test_v4.py @@ -394,6 +394,16 @@ try: except gitlab.GitlabMRClosedError: pass +# protected branches +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 +assert(len(admin_project.protectedbranches.list()) == 2) +admin_project.protectedbranches.delete('master') +p_b.delete() +assert(len(admin_project.protectedbranches.list()) == 0) + # stars admin_project.star() assert(admin_project.star_count == 1) |