From c99e399443819024e2e44cbd437091a39641ae68 Mon Sep 17 00:00:00 2001 From: Gauvain Pocentek Date: Sat, 2 Sep 2017 16:37:43 +0200 Subject: Add support for protected branches This feature appeared in gitlab 9.5. Fixes #299 --- tools/python_test_v4.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/python_test_v4.py') 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) -- cgit v1.2.1