diff --git a/github/PullRequest.py b/github/PullRequest.py index e0515738..7cee6f53 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -38,7 +38,7 @@ import github.File import github.IssueComment import github.Commit import github.PullRequestReview -import github.PullRequestReviewerRequests +import github.PullRequestReviewerRequest class PullRequest(github.GithubObject.CompletableGithubObject): @@ -524,13 +524,13 @@ class PullRequest(github.GithubObject.CompletableGithubObject): headers={'Accept': 'application/vnd.github.black-cat-preview+json'} ) - def get_review_requests(self): + def get_reviewer_requests(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number/requested_reviewers `_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.InspectionReviewers.InspectionReviewers` """ return github.PaginatedList.PaginatedList( - github.PullRequestReviewerRequests.PullRequestReviewerRequests, + github.PullRequestReviewerRequest.PullRequestReviewerRequest, self._requester, self.url + "/requested_reviewers", None, diff --git a/github/PullRequestReviewerRequests.py b/github/PullRequestReviewerRequest.py similarity index 97% rename from github/PullRequestReviewerRequests.py rename to github/PullRequestReviewerRequest.py index 0737d131..6f3ea688 100644 --- a/github/PullRequestReviewerRequests.py +++ b/github/PullRequestReviewerRequest.py @@ -31,7 +31,7 @@ import github.GithubObject import github.NamedUser -class PullRequestReviewerRequests(github.GithubObject.CompletableGithubObject): +class PullRequestReviewerRequest(github.GithubObject.CompletableGithubObject): """ This class represents Pull Request Reviewer Requests as returned for example by https://developer.github.com/v3/pulls/review_requests/ """ diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index e87d2835..f2211a80 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -58,7 +58,7 @@ from Organization import * from PullRequest import * from PullRequestComment import * from PullRequestReview import * -from PullRequestReviewRequests import * +from PullRequestReviewerRequests import * from PullRequestFile import * from RateLimiting import * from Repository import * diff --git a/github/tests/PullRequestReview.py b/github/tests/PullRequestReview.py index 50489600..b6d374ff 100644 --- a/github/tests/PullRequestReview.py +++ b/github/tests/PullRequestReview.py @@ -26,29 +26,26 @@ import Framework -import datetime - - class PullRequestReview(Framework.TestCase): def setUp(self): Framework.TestCase.setUp(self) -# self.pullreview = self.g.get_user().get_repo("PyGithub").get_pull(538).get_review(1): - self.pullreview = self.g.get_user().get_repo("PyGithub").get_pull(538).get_reviews(self) - for ireview in self.pullreview.get_reviews(): - iuser = xstr(ireview.user.login) + " (" + xstr(ireview.user.name) + ")" - istate = xstr(ireview.state) - print("* Review #{0} was {1} by User: {2}; For Commit {3}: Comment = {4}".format(ireview.id, istate, iuser, ireview.commit_id, ireview.body)) - print("* HTML_URL = {0}".format(ireview.html_url)) - print("* Pull Request URL = {0}".format(ireview.pull_request_url)) + self.repo = self.g.get_repo("PyGithub/PyGithub") + self.pull = self.repo.get_pull(538) + + # Test ability to get all reviews + self.pullreviews = self.pull.get_reviews() + + # Test ability to get a single review + self.pullreview = self.pull.get_review(28482091) def testAttributes(self): - self.assertEqual(self.pullreview.body, "Comment created by PyGithub") - self.assertEqual(self.pullreview.commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206") - self.assertEqual(self.pullreview.id, 886298) - self.assertEqual(self.pullreview.state, "src/github/Issue.py") - self.assertEqual(self.pullreview.user.login, "jacquev6") - self.assertEqual(self.pullreview.html_url, "https://github.com/jacquev6/PyGithub/pull/170#issuecomment-18637907") - self.assertEqual(self.pullreview.pull_request_url, "https://github.com/jacquev6/PyGithub/pull/170#issuecomment-18637907") + self.assertEqual(self.pullreview.id, 28482091) + self.assertEqual(self.pullreview.user.login, "jzelinskie") + self.assertEqual(self.pullreview.body, "") + self.assertEqual(self.pullreview.commit_id, "7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc") + self.assertEqual(self.pullreview.state, "APPROVED") + self.assertEqual(self.pullreview.html_url, "https://github.com/PyGithub/PyGithub/pull/538#pullrequestreview-28482091") + self.assertEqual(self.pullreview.pull_request_url, "https://api.github.com/repos/PyGithub/PyGithub/pulls/538") # test __repr__() based on this attributes - self.assertEqual(self.comment.__repr__(), 'PullRequestReview(id=886298, user=NamedUser(login="jacquev6"))') + self.assertEqual(self.pullreview.__repr__(), 'PullRequestReview(user=NamedUser(login="jzelinskie"), id=28482091)') diff --git a/github/tests/PullRequestReviewRequests.py b/github/tests/PullRequestReviewerRequests.py similarity index 78% rename from github/tests/PullRequestReviewRequests.py rename to github/tests/PullRequestReviewerRequests.py index 849e9eff..e99e5232 100644 --- a/github/tests/PullRequestReviewRequests.py +++ b/github/tests/PullRequestReviewerRequests.py @@ -26,19 +26,21 @@ import Framework -import datetime - - -class PullRequestReviewRequests(Framework.TestCase): +class PullRequestReviewerRequests(Framework.TestCase): def setUp(self): Framework.TestCase.setUp(self) - self.pullreviewrequest = self.g.get_user().get_repo("PyGithub").get_pull(538).get_review_requests() - print("* Inspection #{0}, Requested from User {1}".format(self.pullreviewrequest.id, self.pullreviewrequest.login)) + self.repo = self.g.get_repo("PyGithub/PyGithub") + self.pull = self.repo.get_pull(538) + + self.pullreviewerrequests = self.pull.get_reviewer_requests() + self.pullreviewerrequest = self.pullreviewerrequests[0] + def testAttributes(self): - self.assertEqual(self.pullreviewrequest.id, 886298) - self.assertEqual(self.pullreviewrequest.login, "jacquev6") + self.assertEqual(self.pullreviewerrequest.id, 2930472) + self.assertEqual(self.pullreviewerrequest.login, "jayfk") + # test __repr__() based on this attributes - self.assertEqual(self.comment.__repr__(), 'PullRequestReviewRequest(id=886298, user="jacquev6"') + self.assertEqual(self.pullreviewerrequest.__repr__(), 'PullRequestReviewerRequest(login="jayfk", id=2930472)') diff --git a/github/tests/ReplayData/PullRequestReview.setUp.txt b/github/tests/ReplayData/PullRequestReview.setUp.txt new file mode 100644 index 00000000..0dca4cf4 --- /dev/null +++ b/github/tests/ReplayData/PullRequestReview.setUp.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/pulls/538 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('content-length', '14726'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'edf23fdc48375d9066b698b8d98062e9'), ('x-oauth-scopes', 'gist, repo, user'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('x-accepted-oauth-scopes', ''), ('etag', '"f375b2b7b6eb9081788c5e3b1dedba0e"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('status', '200 OK'), ('x-ratelimit-remaining', '4907'), ('x-github-media-type', 'github.v3; 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', 'C1FF:69EB:25C778B:2F12119:58D55E89'), ('last-modified', 'Wed, 22 Mar 2017 19:07:28 GMT'), ('date', 'Fri, 24 Mar 2017 17:59:37 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', '1490379624')] +{"url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538","id":111649703,"html_url":"https://github.com/PyGithub/PyGithub/pull/538","diff_url":"https://github.com/PyGithub/PyGithub/pull/538.diff","patch_url":"https://github.com/PyGithub/PyGithub/pull/538.patch","issue_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/538","number":538,"state":"open","locked":false,"title":"Add Support for Pull Request Reviews feature","user":{"login":"allevin","id":13543471,"avatar_url":"https://avatars1.githubusercontent.com/u/13543471?v=3","gravatar_id":"","url":"https://api.github.com/users/allevin","html_url":"https://github.com/allevin","followers_url":"https://api.github.com/users/allevin/followers","following_url":"https://api.github.com/users/allevin/following{/other_user}","gists_url":"https://api.github.com/users/allevin/gists{/gist_id}","starred_url":"https://api.github.com/users/allevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevin/subscriptions","organizations_url":"https://api.github.com/users/allevin/orgs","repos_url":"https://api.github.com/users/allevin/repos","events_url":"https://api.github.com/users/allevin/events{/privacy}","received_events_url":"https://api.github.com/users/allevin/received_events","type":"User","site_admin":false},"body":"Adding support to Pull Request class to access new Github API features [Pull Request reviews](https://developer.github.com/v3/pulls/reviews/) and [Pull Request Reviewer Requests](https://developer.github.com/v3/pulls/review_requests/)\r\n\r\nThe API's is still in beta. \r\n\r\nI approached this by providing a minimal set of routines to access the list of reviews or a specific review. Also access to get a list of Reviewer requests. \r\n\r\nBecause the API is still early in Beta, I choose not to implement the create/delete/edit features, but the infrastructure should be in place for future improvements.\r\n\r\n","created_at":"2017-03-20T21:00:37Z","updated_at":"2017-03-22T19:07:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"764e59cb251dc0e9aab5be993d4451b35f91b685","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/commits","review_comments_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/comments","review_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/538/comments","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc","head":{"label":"allevin:Add_Pull_Request_Reviews_Feature","ref":"Add_Pull_Request_Reviews_Feature","sha":"7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc","user":{"login":"allevin","id":13543471,"avatar_url":"https://avatars1.githubusercontent.com/u/13543471?v=3","gravatar_id":"","url":"https://api.github.com/users/allevin","html_url":"https://github.com/allevin","followers_url":"https://api.github.com/users/allevin/followers","following_url":"https://api.github.com/users/allevin/following{/other_user}","gists_url":"https://api.github.com/users/allevin/gists{/gist_id}","starred_url":"https://api.github.com/users/allevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevin/subscriptions","organizations_url":"https://api.github.com/users/allevin/orgs","repos_url":"https://api.github.com/users/allevin/repos","events_url":"https://api.github.com/users/allevin/events{/privacy}","received_events_url":"https://api.github.com/users/allevin/received_events","type":"User","site_admin":false},"repo":{"id":85619926,"name":"PyGithub","full_name":"allevin/PyGithub","owner":{"login":"allevin","id":13543471,"avatar_url":"https://avatars1.githubusercontent.com/u/13543471?v=3","gravatar_id":"","url":"https://api.github.com/users/allevin","html_url":"https://github.com/allevin","followers_url":"https://api.github.com/users/allevin/followers","following_url":"https://api.github.com/users/allevin/following{/other_user}","gists_url":"https://api.github.com/users/allevin/gists{/gist_id}","starred_url":"https://api.github.com/users/allevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevin/subscriptions","organizations_url":"https://api.github.com/users/allevin/orgs","repos_url":"https://api.github.com/users/allevin/repos","events_url":"https://api.github.com/users/allevin/events{/privacy}","received_events_url":"https://api.github.com/users/allevin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allevin/PyGithub","description":"Typed interactions with the GitHub API v3","fork":true,"url":"https://api.github.com/repos/allevin/PyGithub","forks_url":"https://api.github.com/repos/allevin/PyGithub/forks","keys_url":"https://api.github.com/repos/allevin/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allevin/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allevin/PyGithub/teams","hooks_url":"https://api.github.com/repos/allevin/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/allevin/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/allevin/PyGithub/events","assignees_url":"https://api.github.com/repos/allevin/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/allevin/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/allevin/PyGithub/tags","blobs_url":"https://api.github.com/repos/allevin/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allevin/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allevin/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/allevin/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allevin/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/allevin/PyGithub/languages","stargazers_url":"https://api.github.com/repos/allevin/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/allevin/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/allevin/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/allevin/PyGithub/subscription","commits_url":"https://api.github.com/repos/allevin/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/allevin/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/allevin/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/allevin/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/allevin/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/allevin/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allevin/PyGithub/merges","archive_url":"https://api.github.com/repos/allevin/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allevin/PyGithub/downloads","issues_url":"https://api.github.com/repos/allevin/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/allevin/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/allevin/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/allevin/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allevin/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/allevin/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/allevin/PyGithub/deployments","created_at":"2017-03-20T19:55:57Z","updated_at":"2017-03-20T19:56:01Z","pushed_at":"2017-03-23T18:08:52Z","git_url":"git://github.com/allevin/PyGithub.git","ssh_url":"git@github.com:allevin/PyGithub.git","clone_url":"https://github.com/allevin/PyGithub.git","svn_url":"https://github.com/allevin/PyGithub","homepage":"","size":12131,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PyGithub:master","ref":"master","sha":"414f6e648f4da87f10bae7d01948a63dc82b80f8","user":{"login":"PyGithub","id":11288996,"avatar_url":"https://avatars3.githubusercontent.com/u/11288996?v=3","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"repo":{"id":3544490,"name":"PyGithub","full_name":"PyGithub/PyGithub","owner":{"login":"PyGithub","id":11288996,"avatar_url":"https://avatars3.githubusercontent.com/u/11288996?v=3","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PyGithub/PyGithub","description":"Typed interactions with the GitHub API v3","fork":false,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/PyGithub/PyGithub/deployments","created_at":"2012-02-25T12:53:47Z","updated_at":"2017-03-22T13:29:26Z","pushed_at":"2017-03-21T19:00:19Z","git_url":"git://github.com/PyGithub/PyGithub.git","ssh_url":"git@github.com:PyGithub/PyGithub.git","clone_url":"https://github.com/PyGithub/PyGithub.git","svn_url":"https://github.com/PyGithub/PyGithub","homepage":"","size":12133,"stargazers_count":1221,"watchers_count":1221,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":403,"mirror_url":null,"open_issues_count":124,"forks":403,"open_issues":124,"watchers":1221,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538"},"html":{"href":"https://github.com/PyGithub/PyGithub/pull/538"},"issue":{"href":"https://api.github.com/repos/PyGithub/PyGithub/issues/538"},"comments":{"href":"https://api.github.com/repos/PyGithub/PyGithub/issues/538/comments"},"review_comments":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/comments"},"review_comment":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/commits"},"statuses":{"href":"https://api.github.com/repos/PyGithub/PyGithub/statuses/7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":3,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":329,"deletions":0,"changed_files":6} + +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/pulls/538/reviews/28482091 +{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.black-cat-preview+json', 'User-Agent': 'PyGithub/Python'} +null +200 +[('content-length', '1389'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'cee4c0729c8e9147e7abcb45b9d69689'), ('x-oauth-scopes', 'gist, repo, user'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('x-accepted-oauth-scopes', ''), ('etag', '"ddc104addccab409de06f166dd96db83"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('status', '200 OK'), ('x-ratelimit-remaining', '4906'), ('x-github-media-type', 'github.black-cat-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', 'C200:69E5:1A3022C:207D2E3:58D55E8A'), ('date', 'Fri, 24 Mar 2017 17:59:38 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', '1490379624')] +{"id":28482091,"user":{"login":"jzelinskie","id":343539,"avatar_url":"https://avatars0.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},"body":"","state":"APPROVED","html_url":"https://github.com/PyGithub/PyGithub/pull/538#pullrequestreview-28482091","pull_request_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538","_links":{"html":{"href":"https://github.com/PyGithub/PyGithub/pull/538#pullrequestreview-28482091"},"pull_request":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538"}},"submitted_at":"2017-03-22T19:06:59Z","commit_id":"7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc"} + diff --git a/github/tests/ReplayData/PullRequestReviewerRequests.setUp.txt b/github/tests/ReplayData/PullRequestReviewerRequests.setUp.txt new file mode 100644 index 00000000..00a2ef6d --- /dev/null +++ b/github/tests/ReplayData/PullRequestReviewerRequests.setUp.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/pulls/538 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('content-length', '14726'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'a474937f3b2fa272558fa6dc951018ad'), ('x-oauth-scopes', 'gist, repo, user'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('x-accepted-oauth-scopes', ''), ('etag', '"f375b2b7b6eb9081788c5e3b1dedba0e"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('status', '200 OK'), ('x-ratelimit-remaining', '4952'), ('x-github-media-type', 'github.v3; 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', 'C19A:69E1:10370BA:13FF894:58D559AE'), ('last-modified', 'Wed, 22 Mar 2017 19:07:28 GMT'), ('date', 'Fri, 24 Mar 2017 17:38:54 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', '1490379624')] +{"url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538","id":111649703,"html_url":"https://github.com/PyGithub/PyGithub/pull/538","diff_url":"https://github.com/PyGithub/PyGithub/pull/538.diff","patch_url":"https://github.com/PyGithub/PyGithub/pull/538.patch","issue_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/538","number":538,"state":"open","locked":false,"title":"Add Support for Pull Request Reviews feature","user":{"login":"allevin","id":13543471,"avatar_url":"https://avatars1.githubusercontent.com/u/13543471?v=3","gravatar_id":"","url":"https://api.github.com/users/allevin","html_url":"https://github.com/allevin","followers_url":"https://api.github.com/users/allevin/followers","following_url":"https://api.github.com/users/allevin/following{/other_user}","gists_url":"https://api.github.com/users/allevin/gists{/gist_id}","starred_url":"https://api.github.com/users/allevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevin/subscriptions","organizations_url":"https://api.github.com/users/allevin/orgs","repos_url":"https://api.github.com/users/allevin/repos","events_url":"https://api.github.com/users/allevin/events{/privacy}","received_events_url":"https://api.github.com/users/allevin/received_events","type":"User","site_admin":false},"body":"Adding support to Pull Request class to access new Github API features [Pull Request reviews](https://developer.github.com/v3/pulls/reviews/) and [Pull Request Reviewer Requests](https://developer.github.com/v3/pulls/review_requests/)\r\n\r\nThe API's is still in beta. \r\n\r\nI approached this by providing a minimal set of routines to access the list of reviews or a specific review. Also access to get a list of Reviewer requests. \r\n\r\nBecause the API is still early in Beta, I choose not to implement the create/delete/edit features, but the infrastructure should be in place for future improvements.\r\n\r\n","created_at":"2017-03-20T21:00:37Z","updated_at":"2017-03-22T19:07:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"764e59cb251dc0e9aab5be993d4451b35f91b685","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/commits","review_comments_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/comments","review_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/538/comments","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc","head":{"label":"allevin:Add_Pull_Request_Reviews_Feature","ref":"Add_Pull_Request_Reviews_Feature","sha":"7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc","user":{"login":"allevin","id":13543471,"avatar_url":"https://avatars1.githubusercontent.com/u/13543471?v=3","gravatar_id":"","url":"https://api.github.com/users/allevin","html_url":"https://github.com/allevin","followers_url":"https://api.github.com/users/allevin/followers","following_url":"https://api.github.com/users/allevin/following{/other_user}","gists_url":"https://api.github.com/users/allevin/gists{/gist_id}","starred_url":"https://api.github.com/users/allevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevin/subscriptions","organizations_url":"https://api.github.com/users/allevin/orgs","repos_url":"https://api.github.com/users/allevin/repos","events_url":"https://api.github.com/users/allevin/events{/privacy}","received_events_url":"https://api.github.com/users/allevin/received_events","type":"User","site_admin":false},"repo":{"id":85619926,"name":"PyGithub","full_name":"allevin/PyGithub","owner":{"login":"allevin","id":13543471,"avatar_url":"https://avatars1.githubusercontent.com/u/13543471?v=3","gravatar_id":"","url":"https://api.github.com/users/allevin","html_url":"https://github.com/allevin","followers_url":"https://api.github.com/users/allevin/followers","following_url":"https://api.github.com/users/allevin/following{/other_user}","gists_url":"https://api.github.com/users/allevin/gists{/gist_id}","starred_url":"https://api.github.com/users/allevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allevin/subscriptions","organizations_url":"https://api.github.com/users/allevin/orgs","repos_url":"https://api.github.com/users/allevin/repos","events_url":"https://api.github.com/users/allevin/events{/privacy}","received_events_url":"https://api.github.com/users/allevin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/allevin/PyGithub","description":"Typed interactions with the GitHub API v3","fork":true,"url":"https://api.github.com/repos/allevin/PyGithub","forks_url":"https://api.github.com/repos/allevin/PyGithub/forks","keys_url":"https://api.github.com/repos/allevin/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allevin/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allevin/PyGithub/teams","hooks_url":"https://api.github.com/repos/allevin/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/allevin/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/allevin/PyGithub/events","assignees_url":"https://api.github.com/repos/allevin/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/allevin/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/allevin/PyGithub/tags","blobs_url":"https://api.github.com/repos/allevin/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allevin/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allevin/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/allevin/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allevin/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/allevin/PyGithub/languages","stargazers_url":"https://api.github.com/repos/allevin/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/allevin/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/allevin/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/allevin/PyGithub/subscription","commits_url":"https://api.github.com/repos/allevin/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/allevin/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/allevin/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/allevin/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/allevin/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/allevin/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allevin/PyGithub/merges","archive_url":"https://api.github.com/repos/allevin/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allevin/PyGithub/downloads","issues_url":"https://api.github.com/repos/allevin/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/allevin/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/allevin/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/allevin/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allevin/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/allevin/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/allevin/PyGithub/deployments","created_at":"2017-03-20T19:55:57Z","updated_at":"2017-03-20T19:56:01Z","pushed_at":"2017-03-23T18:08:52Z","git_url":"git://github.com/allevin/PyGithub.git","ssh_url":"git@github.com:allevin/PyGithub.git","clone_url":"https://github.com/allevin/PyGithub.git","svn_url":"https://github.com/allevin/PyGithub","homepage":"","size":12131,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"PyGithub:master","ref":"master","sha":"414f6e648f4da87f10bae7d01948a63dc82b80f8","user":{"login":"PyGithub","id":11288996,"avatar_url":"https://avatars3.githubusercontent.com/u/11288996?v=3","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"repo":{"id":3544490,"name":"PyGithub","full_name":"PyGithub/PyGithub","owner":{"login":"PyGithub","id":11288996,"avatar_url":"https://avatars3.githubusercontent.com/u/11288996?v=3","gravatar_id":"","url":"https://api.github.com/users/PyGithub","html_url":"https://github.com/PyGithub","followers_url":"https://api.github.com/users/PyGithub/followers","following_url":"https://api.github.com/users/PyGithub/following{/other_user}","gists_url":"https://api.github.com/users/PyGithub/gists{/gist_id}","starred_url":"https://api.github.com/users/PyGithub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PyGithub/subscriptions","organizations_url":"https://api.github.com/users/PyGithub/orgs","repos_url":"https://api.github.com/users/PyGithub/repos","events_url":"https://api.github.com/users/PyGithub/events{/privacy}","received_events_url":"https://api.github.com/users/PyGithub/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PyGithub/PyGithub","description":"Typed interactions with the GitHub API v3","fork":false,"url":"https://api.github.com/repos/PyGithub/PyGithub","forks_url":"https://api.github.com/repos/PyGithub/PyGithub/forks","keys_url":"https://api.github.com/repos/PyGithub/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PyGithub/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PyGithub/PyGithub/teams","hooks_url":"https://api.github.com/repos/PyGithub/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/PyGithub/PyGithub/events","assignees_url":"https://api.github.com/repos/PyGithub/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/PyGithub/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/PyGithub/PyGithub/tags","blobs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PyGithub/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PyGithub/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/PyGithub/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PyGithub/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/PyGithub/PyGithub/languages","stargazers_url":"https://api.github.com/repos/PyGithub/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/PyGithub/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/PyGithub/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/PyGithub/PyGithub/subscription","commits_url":"https://api.github.com/repos/PyGithub/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/PyGithub/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/PyGithub/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/PyGithub/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/PyGithub/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/PyGithub/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PyGithub/PyGithub/merges","archive_url":"https://api.github.com/repos/PyGithub/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PyGithub/PyGithub/downloads","issues_url":"https://api.github.com/repos/PyGithub/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/PyGithub/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/PyGithub/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/PyGithub/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PyGithub/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/PyGithub/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/PyGithub/PyGithub/deployments","created_at":"2012-02-25T12:53:47Z","updated_at":"2017-03-22T13:29:26Z","pushed_at":"2017-03-21T19:00:19Z","git_url":"git://github.com/PyGithub/PyGithub.git","ssh_url":"git@github.com:PyGithub/PyGithub.git","clone_url":"https://github.com/PyGithub/PyGithub.git","svn_url":"https://github.com/PyGithub/PyGithub","homepage":"","size":12133,"stargazers_count":1221,"watchers_count":1221,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":403,"mirror_url":null,"open_issues_count":124,"forks":403,"open_issues":124,"watchers":1221,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538"},"html":{"href":"https://github.com/PyGithub/PyGithub/pull/538"},"issue":{"href":"https://api.github.com/repos/PyGithub/PyGithub/issues/538"},"comments":{"href":"https://api.github.com/repos/PyGithub/PyGithub/issues/538/comments"},"review_comments":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/comments"},"review_comment":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PyGithub/PyGithub/pulls/538/commits"},"statuses":{"href":"https://api.github.com/repos/PyGithub/PyGithub/statuses/7a0fcb27b7cd6c346fc3f76216ccb6e0f4ca3bcc"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":3,"review_comments":0,"maintainer_can_modify":true,"commits":3,"additions":329,"deletions":0,"changed_files":6} + +https +GET +api.github.com +None +/repos/PyGithub/PyGithub/pulls/538/requested_reviewers +{'Authorization': 'Basic login_and_password_removed', 'Accept': 'application/vnd.github.black-cat-preview+json', 'User-Agent': 'PyGithub/Python'} +null +200 +[('content-length', '839'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', '07ff1c8a09e44b62e277fae50a1b1dc4'), ('x-oauth-scopes', 'gist, repo, user'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('x-accepted-oauth-scopes', ''), ('etag', '"bc596203c153ef71a3f3e99a908de946"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('status', '200 OK'), ('x-ratelimit-remaining', '4951'), ('x-github-media-type', 'github.black-cat-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', 'C19B:69EB:2590DF2:2ECC945:58D559AE'), ('date', 'Fri, 24 Mar 2017 17:38:55 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', '1490379624')] +[{"login":"jayfk","id":2930472,"avatar_url":"https://avatars1.githubusercontent.com/u/2930472?v=3","gravatar_id":"","url":"https://api.github.com/users/jayfk","html_url":"https://github.com/jayfk","followers_url":"https://api.github.com/users/jayfk/followers","following_url":"https://api.github.com/users/jayfk/following{/other_user}","gists_url":"https://api.github.com/users/jayfk/gists{/gist_id}","starred_url":"https://api.github.com/users/jayfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayfk/subscriptions","organizations_url":"https://api.github.com/users/jayfk/orgs","repos_url":"https://api.github.com/users/jayfk/repos","events_url":"https://api.github.com/users/jayfk/events{/privacy}","received_events_url":"https://api.github.com/users/jayfk/received_events","type":"User","site_admin":false}] +