mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 19:31:10 +00:00
Merge pull request #372 from khornberg/protect-branch
Add branch protection endpoint
This commit is contained in:
@@ -49,6 +49,27 @@ class Branch(github.GithubObject.NonCompletableGithubObject):
|
||||
"""
|
||||
return self._name.value
|
||||
|
||||
@property
|
||||
def protected(self):
|
||||
"""
|
||||
:type: bool
|
||||
"""
|
||||
return self._protected.value
|
||||
|
||||
@property
|
||||
def enforcement_level(self):
|
||||
"""
|
||||
:type: string
|
||||
"""
|
||||
return self._enforcement_level.value
|
||||
|
||||
@property
|
||||
def contexts(self):
|
||||
"""
|
||||
:type: list of strings
|
||||
"""
|
||||
return self._contexts.value
|
||||
|
||||
def _initAttributes(self):
|
||||
self._commit = github.GithubObject.NotSet
|
||||
self._name = github.GithubObject.NotSet
|
||||
@@ -58,3 +79,7 @@ class Branch(github.GithubObject.NonCompletableGithubObject):
|
||||
self._commit = self._makeClassAttribute(github.Commit.Commit, attributes["commit"])
|
||||
if "name" in attributes: # pragma no branch
|
||||
self._name = self._makeStringAttribute(attributes["name"])
|
||||
if "protection" in attributes:
|
||||
self._protected = self._makeBoolAttribute(attributes["protection"]["enabled"])
|
||||
self._enforcement_level = self._makeStringAttribute(attributes["protection"]["required_status_checks"]["enforcement_level"])
|
||||
self._contexts = self._makeListOfStringsAttribute(attributes["protection"]["required_status_checks"]["contexts"])
|
||||
|
||||
@@ -1090,6 +1090,20 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
)
|
||||
return github.Branch.Branch(self._requester, headers, data, completed=True)
|
||||
|
||||
def get_protected_branch(self, branch):
|
||||
"""
|
||||
:calls: `GET /repos/:owner/:repo/branches/:branch <https://developer.github.com/v3/repos/#response-10>`_
|
||||
:param branch: string
|
||||
:rtype: :class:`github.Branch.Branch`
|
||||
"""
|
||||
assert isinstance(branch, (str, unicode)), branch
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"GET",
|
||||
self.url + "/branches/" + branch,
|
||||
headers={'Accept': 'application/vnd.github.loki-preview+json'}
|
||||
)
|
||||
return github.Branch.Branch(self._requester, headers, data, completed=True)
|
||||
|
||||
def get_branches(self):
|
||||
"""
|
||||
:calls: `GET /repos/:owner/:repo/branches <http://developer.github.com/v3/repos>`_
|
||||
@@ -2007,6 +2021,38 @@ class Repository(github.GithubObject.CompletableGithubObject):
|
||||
else:
|
||||
return github.Commit.Commit(self._requester, headers, data, completed=True)
|
||||
|
||||
def protect_branch(self, branch, enabled, enforcement_level=github.GithubObject.NotSet, contexts=github.GithubObject.NotSet):
|
||||
"""
|
||||
:calls: `PATCH /repos/:owner/:repo/branches/:branch <https://developer.github.com/v3/repos/#enabling-and-disabling-branch-protection>`_
|
||||
:param branch: string
|
||||
:param enabled: boolean
|
||||
:param enforcement_level: string
|
||||
:param contexts: list of strings
|
||||
:rtype: None
|
||||
"""
|
||||
|
||||
assert isinstance(branch, (str, unicode))
|
||||
assert isinstance(enabled, bool)
|
||||
assert enforcement_level is github.GithubObject.NotSet or isinstance(enforcement_level, (str, unicode)), enforcement_level
|
||||
assert contexts is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) or isinstance(element, str) for element in contexts), contexts
|
||||
|
||||
post_parameters = {
|
||||
"protection": {}
|
||||
}
|
||||
if enabled is not github.GithubObject.NotSet:
|
||||
post_parameters["protection"]["enabled"] = enabled
|
||||
if enforcement_level is not github.GithubObject.NotSet:
|
||||
post_parameters["protection"]["required_status_checks"] = {}
|
||||
post_parameters["protection"]["required_status_checks"]["enforcement_level"] = enforcement_level
|
||||
if contexts is not github.GithubObject.NotSet:
|
||||
post_parameters["protection"]["required_status_checks"]["contexts"] = contexts
|
||||
headers, data = self._requester.requestJsonAndCheck(
|
||||
"PATCH",
|
||||
self.url + "/branches/" + branch,
|
||||
input=post_parameters,
|
||||
headers={'Accept': 'application/vnd.github.loki-preview+json'}
|
||||
)
|
||||
|
||||
def remove_from_collaborators(self, collaborator):
|
||||
"""
|
||||
:calls: `DELETE /repos/:owner/:repo/collaborators/:user <http://developer.github.com/v3/repos/collaborators>`_
|
||||
|
||||
@@ -34,3 +34,10 @@ class Branch(Framework.TestCase):
|
||||
def testAttributes(self):
|
||||
self.assertEqual(self.branch.name, "topic/RewriteWithGeneratedCode")
|
||||
self.assertEqual(self.branch.commit.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a")
|
||||
|
||||
def testProtectedAttributes(self):
|
||||
self.branch = self.g.get_user().get_repo("PyGithub").get_protected_branch("master")
|
||||
self.assertEqual(self.branch.name, "master")
|
||||
self.assertFalse(self.branch.protected)
|
||||
self.assertEqual(self.branch.enforcement_level, "off")
|
||||
self.assertEqual(self.branch.contexts, [])
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,66 @@
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone", "contexts": ["test"]}}}
|
||||
200
|
||||
[('content-length', '3599'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '76d9828c7e4f1d910f7ba069e90ce976'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"23247e636875225f1e2d6b49e3ed8fb5"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4983'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D25A:7429E1A:568D31F4'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:25:40 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["test"]}}}
|
||||
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('content-length', '3599'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'bae57931a6fe678a3dffe9be8e7819c8'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"23247e636875225f1e2d6b49e3ed8fb5"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4982'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D262:27FA573A:568D31F4'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:25:40 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["test"]}}}
|
||||
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone", "contexts": ["test", "default"]}}}
|
||||
200
|
||||
[('content-length', '3609'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '318e55760cf7cdb40e61175a4d36cd32'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"db7b04fd5e1b51731388d165caa9c4aa"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4981'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D262:27FA5773:568D31F4'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:25:41 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["default","test"]}}}
|
||||
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('content-length', '3609'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'a241e1a8264a6ace03db946c85b92db3'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"db7b04fd5e1b51731388d165caa9c4aa"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4980'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D260:22667B15:568D31F5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:25:41 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["default","test"]}}}
|
||||
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone", "contexts": ["default"]}}}
|
||||
200
|
||||
[('content-length', '3602'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '593010132f82159af0ded24b4932e109'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"9ec429649fdda2858153edc42ff3f579"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4979'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D25F:1A8AB79A:568D31F5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:25:41 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["default"]}}}
|
||||
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('content-length', '3602'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'ef96c2e493b28ffea49b891b085ed2dd'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"9ec429649fdda2858153edc42ff3f579"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D262:27FA5800:568D31F5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:25:41 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["default"]}}}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone", "contexts": ["test"]}}}
|
||||
200
|
||||
[('content-length', '3599'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'dc1ce2bfb41810a06c705e83b388572d'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"23247e636875225f1e2d6b49e3ed8fb5"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4950'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D25F:1A90BAC8:568D38A5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:54:13 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["test"]}}}
|
||||
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('content-length', '3599'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '2c18a09f3ac5e4dd1e004af7c5a94769'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"23247e636875225f1e2d6b49e3ed8fb5"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4949'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D261:29009CF7:568D38A5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:54:13 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["test"]}}}
|
||||
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "non_admins", "contexts": ["test"]}}}
|
||||
200
|
||||
[('content-length', '3601'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '52437fedc85beec8da3449496900fb9a'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"33854f0fd77af9f49acf152bf0715de3"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4948'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D25F:1A90BB33:568D38A5'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:54:14 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"non_admins","contexts":["test"]}}}
|
||||
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('content-length', '3601'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '13d09b732ebe76f892093130dc088652'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"33854f0fd77af9f49acf152bf0715de3"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4947'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:1D260:226E126E:568D38A7'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:54:15 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"non_admins","contexts":["test"]}}}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone", "contexts": ["test"]}}}
|
||||
200
|
||||
[('content-length', '3599'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '13d09b732ebe76f892093130dc088652'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"23247e636875225f1e2d6b49e3ed8fb5"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4997'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:14B62:29334564:568D2D11'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:04:49 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["test"]}}}
|
||||
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('content-length', '3599'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'a474937f3b2fa272558fa6dc951018ad'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"23247e636875225f1e2d6b49e3ed8fb5"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:14B62:293345B4:568D2D11'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:04:49 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":true,"required_status_checks":{"enforcement_level":"everyone","contexts":["test"]}}}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "", "contexts": ["test"]}}}
|
||||
422
|
||||
[('status', '422 Unprocessable Entity'), ('content-length', '331'), ('x-github-media-type', 'github.loki-preview; format=json'), ('x-content-type-options', 'nosniff'), ('content-security-policy', "default-src 'none'"), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'AE1E5031:134EF:B336C18:568E6F16'), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('x-ratelimit-remaining', '4958'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-xss-protection', '1; mode=block'), ('access-control-allow-credentials', 'true'), ('date', 'Thu, 07 Jan 2016 13:58:47 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-frame-options', 'deny'), ('x-ratelimit-reset', '1452177625')]
|
||||
{"message":"Validation Failed","errors":[{"resource":"ProtectedBranch","code":"custom","field":"required_status_checks_enforcement_level","message":"required_status_checks_enforcement_level enforcement level '%s' is not valid"}],"documentation_url":"https://developer.github.com/v3/repos/#enabling-and-disabling-branch-protection"}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone"}}}
|
||||
422
|
||||
[('status', '422 Unprocessable Entity'), ('content-length', '117'), ('x-github-media-type', 'github.loki-preview; format=json'), ('x-content-type-options', 'nosniff'), ('content-security-policy', "default-src 'none'"), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'AE1E5031:1D259:685F04B:568E6DC2'), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('x-ratelimit-remaining', '4969'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-xss-protection', '1; mode=block'), ('access-control-allow-credentials', 'true'), ('date', 'Thu, 07 Jan 2016 13:53:06 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-frame-options', 'deny'), ('x-ratelimit-reset', '1452177625')]
|
||||
{"message":"Invalid request.\n\n\"contexts\" wasn't supplied.","documentation_url":"https://developer.github.com/v3"}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": true, "required_status_checks": {"enforcement_level": "everyone", "contexts": ["test"]}}}
|
||||
404
|
||||
[('status', '404 Not Found'), ('content-length', '102'), ('x-github-media-type', 'github.loki-preview; format=json'), ('x-content-type-options', 'nosniff'), ('content-security-policy', "default-src 'none'"), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'AE1E5031:A39B:2D392574:568E6BC1'), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('x-ratelimit-remaining', '4991'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-xss-protection', '1; mode=block'), ('access-control-allow-credentials', 'true'), ('date', 'Thu, 07 Jan 2016 13:44:34 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-frame-options', 'deny'), ('x-ratelimit-reset', '1452177625')]
|
||||
{"message":"Branch not found","documentation_url":"https://developer.github.com/v3/repos/#get-branch"}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
https
|
||||
PATCH
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
{"protection": {"enabled": false}}
|
||||
200
|
||||
[('content-length', '3589'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'a7f8a126c9ed3f1c4715a34c0ddc7290'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"62bfcfb47e26986d4c1a6db0bcf43cb6"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4993'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:14B5A:E23F8D0:568D3163'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:23:15 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":false,"required_status_checks":{"enforcement_level":"off","contexts":[]}}}
|
||||
|
||||
https
|
||||
GET
|
||||
api.github.com
|
||||
None
|
||||
/repos/khornberg/PyGithub/branches/master
|
||||
{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.loki-preview+json', 'User-Agent': 'PyGithub/Python'}
|
||||
null
|
||||
200
|
||||
[('content-length', '3589'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'c6c65e5196703428e7641f7d1e9bc353'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"62bfcfb47e26986d4c1a6db0bcf43cb6"'), ('access-control-allow-credentials', 'true'), ('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('x-github-media-type', 'github.loki-preview; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '417D879D:14B61:22B7F0CB:568D3164'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Wed, 06 Jan 2016 15:23:16 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1452096288')]
|
||||
{"name":"master","commit":{"sha":"a39c1e8b9ab601419277eefb4fbb586ded0af146","commit":{"author":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"committer":{"name":"Jimmy Zelinskie","email":"jimmyzelinskie@gmail.com","date":"2015-12-16T06:29:19Z"},"message":"Merge pull request #365 from PyGithub/nhomar-travis-button\n\nAdd travis button on README.","tree":{"sha":"33b533e02e45deccc832bc39813710764fb2a9d4","url":"https://api.github.com/repos/khornberg/PyGithub/git/trees/33b533e02e45deccc832bc39813710764fb2a9d4"},"url":"https://api.github.com/repos/khornberg/PyGithub/git/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","comment_count":0},"url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146","html_url":"https://github.com/khornberg/PyGithub/commit/a39c1e8b9ab601419277eefb4fbb586ded0af146","comments_url":"https://api.github.com/repos/khornberg/PyGithub/commits/a39c1e8b9ab601419277eefb4fbb586ded0af146/comments","author":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"committer":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars.githubusercontent.com/u/343539?v=3","gravatar_id":"","url":"https://api.github.com/users/jzelinskie","html_url":"https://github.com/jzelinskie","followers_url":"https://api.github.com/users/jzelinskie/followers","following_url":"https://api.github.com/users/jzelinskie/following{/other_user}","gists_url":"https://api.github.com/users/jzelinskie/gists{/gist_id}","starred_url":"https://api.github.com/users/jzelinskie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jzelinskie/subscriptions","organizations_url":"https://api.github.com/users/jzelinskie/orgs","repos_url":"https://api.github.com/users/jzelinskie/repos","events_url":"https://api.github.com/users/jzelinskie/events{/privacy}","received_events_url":"https://api.github.com/users/jzelinskie/received_events","type":"User","site_admin":false},"parents":[{"sha":"45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","url":"https://api.github.com/repos/khornberg/PyGithub/commits/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5","html_url":"https://github.com/khornberg/PyGithub/commit/45c7f072e4732f89a9e756a27a4306f2f6dbd9c5"},{"sha":"a83649b68f1bb978c254f4cf1efcae88dc2608d7","url":"https://api.github.com/repos/khornberg/PyGithub/commits/a83649b68f1bb978c254f4cf1efcae88dc2608d7","html_url":"https://github.com/khornberg/PyGithub/commit/a83649b68f1bb978c254f4cf1efcae88dc2608d7"}]},"_links":{"self":"https://api.github.com/repos/khornberg/PyGithub/branches/master","html":"https://github.com/khornberg/PyGithub/tree/master"},"protection":{"enabled":false,"required_status_checks":{"enforcement_level":"off","contexts":[]}}}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# ########################## Copyrights and license ############################
|
||||
# #
|
||||
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
|
||||
@@ -69,6 +67,102 @@ class Repository(Framework.TestCase):
|
||||
self.assertEqual(self.repo.url, "https://api.github.com/repos/jacquev6/PyGithub")
|
||||
self.assertEqual(self.repo.watchers, 15)
|
||||
|
||||
def testProtectBranch(self):
|
||||
self.repo.protect_branch("master", True, "everyone", ["test"])
|
||||
branch = self.repo.get_protected_branch("master")
|
||||
self.assertTrue(branch.protected)
|
||||
self.assertEqual(branch.enforcement_level, "everyone")
|
||||
self.assertEqual(branch.contexts, ["test"])
|
||||
# Remove Protection
|
||||
self.repo.protect_branch("master", False)
|
||||
|
||||
def testRemoveBranchProtection(self):
|
||||
self.repo.protect_branch("master", False)
|
||||
branch = self.repo.get_protected_branch("master")
|
||||
self.assertFalse(branch.protected)
|
||||
self.assertEqual(branch.enforcement_level, "off")
|
||||
self.assertEqual(branch.contexts, [])
|
||||
|
||||
def testChangeBranchProtectionContexts(self):
|
||||
self.repo.protect_branch("master", True, "everyone", ["test"])
|
||||
branch = self.repo.get_protected_branch("master")
|
||||
self.assertTrue(branch.protected)
|
||||
self.assertEqual(branch.enforcement_level, "everyone")
|
||||
self.assertEqual(branch.contexts, ["test"])
|
||||
self.repo.protect_branch("master", True, "everyone", ["test", "default"])
|
||||
branch = self.repo.get_protected_branch("master")
|
||||
self.assertEqual(branch.contexts, ["default", "test"])
|
||||
self.repo.protect_branch("master", True, "everyone", ["default"])
|
||||
branch = self.repo.get_protected_branch("master")
|
||||
self.assertEqual(branch.contexts, ["default"])
|
||||
# Remove Protection
|
||||
self.repo.protect_branch("master", False)
|
||||
|
||||
def testRaiseErrorWithOutBranch(self):
|
||||
raised = False
|
||||
try:
|
||||
self.repo.protect_branch("", True, "everyone", ["test"])
|
||||
except github.GithubException, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.status, 404)
|
||||
self.assertEqual(
|
||||
exception.data, {
|
||||
u'documentation_url': u'https://developer.github.com/v3/repos/#get-branch',
|
||||
u'message': u'Branch not found'
|
||||
}
|
||||
)
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testRaiseErrorWithBranchProtectionWithOutContext(self):
|
||||
raised = False
|
||||
try:
|
||||
self.repo.protect_branch("master", True, "everyone")
|
||||
except github.GithubException, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.status, 422)
|
||||
self.assertEqual(
|
||||
exception.data, {
|
||||
u'documentation_url': u'https://developer.github.com/v3',
|
||||
u'message': u'Invalid request.\n\n"contexts" wasn\'t supplied.'
|
||||
}
|
||||
)
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testRaiseErrorWithBranchProtectionWithInvalidEnforcementLevel(self):
|
||||
raised = False
|
||||
try:
|
||||
self.repo.protect_branch("master", True, "", ["test"])
|
||||
except github.GithubException, exception:
|
||||
raised = True
|
||||
self.assertEqual(exception.status, 422)
|
||||
self.assertEqual(
|
||||
exception.data, {
|
||||
u'documentation_url':
|
||||
u'https://developer.github.com/v3/repos/#enabling-and-disabling-branch-protection',
|
||||
u'message': u'Validation Failed',
|
||||
u'errors': [
|
||||
{
|
||||
u'field': u'required_status_checks_enforcement_level',
|
||||
u'message': u"required_status_checks_enforcement_level enforcement level '%s' is not valid",
|
||||
u'code': u'custom',
|
||||
u'resource': u'ProtectedBranch'
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
self.assertTrue(raised)
|
||||
|
||||
def testChangeBranchProtectionEnforcementLevel(self):
|
||||
self.repo.protect_branch("master", True, "everyone", ["test"])
|
||||
branch = self.repo.get_protected_branch("master")
|
||||
self.assertTrue(branch.protected)
|
||||
self.assertEqual(branch.enforcement_level, "everyone")
|
||||
self.repo.protect_branch("master", True, "non_admins", ["test"])
|
||||
branch = self.repo.get_protected_branch("master")
|
||||
self.assertEqual(branch.enforcement_level, "non_admins")
|
||||
# Remove Protection
|
||||
self.repo.protect_branch("master", False)
|
||||
|
||||
def testEditWithoutArguments(self):
|
||||
self.repo.edit("PyGithub")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user