Files
PyGithub/github/tests/AllTests.py
T
Steve Kowalik 171cc567ae Update Branch Protection to current GitHub API
The Branch protection API has been radically changed by GitHub, add new
methods to Branch reflecting it. Branch protection methods are now
called on the Branch object itself, rather than awkwardly hanging off
the Repository object and requiring branch names to be passed in.

This adds an over-arching methods to get, edit and remove protection
entirely, as well as fine-grained methods for getting, setting and
dropping certain aspects of branch protection, as well as three new
objects to encompass querying those aspects.

This also destroys Repository.protect_branch(), the endpoint has been
removed. The old-style protection attributes on Branch have also been
removed to force users onto the new API, since they are still sent, but
no longer populated.

Fixes #586
2018-08-15 12:45:47 +10:00

117 lines
4.6 KiB
Python

# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> #
# Copyright 2013 AKFish <akfish@gmail.com> #
# Copyright 2013 David Farr <david.farr@sap.com> #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2015 Ed Holland <eholland@alertlogic.com> #
# Copyright 2016 John Eskew <jeskew@edx.org> #
# Copyright 2016 Matthew Neal <meneal@matthews-mbp.raleigh.ibm.com> #
# Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> #
# Copyright 2016 Sam Corbett <sam.corbett@cloudsoftcorp.com> #
# Copyright 2017 Aaron Levine <allevin@sandia.gov> #
# Copyright 2017 Nicolas Agustín Torres <nicolastrres@gmail.com> #
# Copyright 2018 sfdye <tsfdye@gmail.com> #
# #
# This file is part of PyGithub. #
# http://pygithub.readthedocs.io/ #
# #
# PyGithub is free software: you can redistribute it and/or modify it under #
# the terms of the GNU Lesser General Public License as published by the Free #
# Software Foundation, either version 3 of the License, or (at your option) #
# any later version. #
# #
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
# details. #
# #
# You should have received a copy of the GNU Lesser General Public License #
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
# #
################################################################################
from AuthenticatedUser import *
from Authentication import *
from Authorization import *
from Branch import *
from BranchProtection import *
from Commit import *
from CommitCombinedStatus import *
from CommitComment import *
from CommitStatus import *
from ContentFile import *
from Download import *
from Event import *
from Gist import *
from GistComment import *
from GitBlob import *
from GitCommit import *
from Github_ import *
from GitRef import *
from GitRelease import *
from GitReleaseAsset import *
from GitTag import *
from GitTree import *
from Hook import *
from Issue import *
from IssueComment import *
from Reaction import *
from IssueEvent import *
from License import *
from Label import *
from Milestone import *
from NamedUser import *
from Markdown import *
from OrganizationHasInMembers import *
from Organization import *
from PullRequest import *
from PullRequestComment import *
from PullRequestReview import *
from PullRequestFile import *
from RateLimiting import *
from Repository import *
from RepositoryKey import *
from RequiredPullRequestReviews import *
from RequiredStatusChecks import *
from SourceImport import *
from Status import *
from Tag import *
from Team import *
from UserKey import *
from PaginatedList import *
from Exceptions import *
from Enterprise import *
from Logging_ import *
from RawData import *
from ConditionalRequestUpdate import *
from Persistence import *
from ExposeAllAttributes import *
from BadAttributes import *
from Equality import *
from Search import *
from Issue33 import *
from Issue50 import *
from Issue54 import *
from Issue80 import *
from Issue87 import *
from Issue131 import *
from Issue133 import *
from Issue134 import *
from Issue139 import *
from Issue140 import *
from Issue142 import *
from Issue158 import *
from Issue174 import *
from Issue214 import *
from Issue216 import *
from Issue278 import *
from Issue494 import *
from Issue572 import *