From c8a945bb422b862a5a32001749f77457a6d55374 Mon Sep 17 00:00:00 2001 From: Claire Johns <42869556+johnsc1@users.noreply.github.com> Date: Sun, 24 Oct 2021 00:15:31 -0400 Subject: [PATCH] Add function to delete pending reviews on a pull request (#1897) Add a delete method to PullRequestReview to allow dismissing them. Fixes #1856 Co-authored-by: bagashvilit Co-authored-by: WonjoonC --- github/PullRequestReview.py | 9 ++++++++ github/PullRequestReview.pyi | 1 + tests/PullRequestReview.py | 1 + tests/PullRequestReview1856.py | 14 ++++++++++++ .../PullRequestReview1856.setUp.txt | 22 +++++++++++++++++++ .../PullRequestReview1856.testDelete.txt | 22 +++++++++++++++++++ 6 files changed, 69 insertions(+) create mode 100644 tests/PullRequestReview1856.py create mode 100644 tests/ReplayData/PullRequestReview1856.setUp.txt create mode 100644 tests/ReplayData/PullRequestReview1856.testDelete.txt diff --git a/github/PullRequestReview.py b/github/PullRequestReview.py index 34eed25afd..bd70f68f2b 100644 --- a/github/PullRequestReview.py +++ b/github/PullRequestReview.py @@ -105,6 +105,15 @@ def dismiss(self, message): input=post_parameters, ) + def delete(self): + """ + :calls: `DELETE /repos/:owner/:repo/pulls/:number/reviews/:review_id `_ + :rtype: None + """ + headers, data = self._requester.requestJsonAndCheck( + "DELETE", f"{self.pull_request_url}/reviews/{self.id}" + ) + def _initAttributes(self): self._id = github.GithubObject.NotSet self._user = github.GithubObject.NotSet diff --git a/github/PullRequestReview.pyi b/github/PullRequestReview.pyi index 269da086ce..e67bcc22ed 100644 --- a/github/PullRequestReview.pyi +++ b/github/PullRequestReview.pyi @@ -13,6 +13,7 @@ class PullRequestReview(CompletableGithubObject): @property def commit_id(self) -> str: ... def dismiss(self, message: str) -> None: ... + def delete(self) -> None: ... @property def html_url(self) -> str: ... @property diff --git a/tests/PullRequestReview.py b/tests/PullRequestReview.py index a2e317cc46..2594c7d8ed 100644 --- a/tests/PullRequestReview.py +++ b/tests/PullRequestReview.py @@ -32,6 +32,7 @@ class PullRequestReview(Framework.TestCase): def setUp(self): super().setUp() + self.repo = self.g.get_repo("PyGithub/PyGithub", lazy=True) self.pull = self.repo.get_pull(538) diff --git a/tests/PullRequestReview1856.py b/tests/PullRequestReview1856.py new file mode 100644 index 0000000000..4343bac016 --- /dev/null +++ b/tests/PullRequestReview1856.py @@ -0,0 +1,14 @@ +from . import Framework + + +class PullRequestReview1856(Framework.TestCase): + def setUp(self): + super().setUp() + pumpkin_repo = self.g.get_repo("CS481-Team-Pumpkin/PyGithub", lazy=True) + self.pumpkin_pull = pumpkin_repo.get_pull(4) + self.pullreview = self.pumpkin_pull.get_review(631460061) + + def testDelete(self): + self.pullreview.delete() + reviews = self.pumpkin_pull.get_reviews() + self.assertEqual(list(reviews), []) diff --git a/tests/ReplayData/PullRequestReview1856.setUp.txt b/tests/ReplayData/PullRequestReview1856.setUp.txt new file mode 100644 index 0000000000..70ffa8a9c3 --- /dev/null +++ b/tests/ReplayData/PullRequestReview1856.setUp.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/repos/CS481-Team-Pumpkin/PyGithub/pulls/4 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 08 Apr 2021 14:27:12 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"8639f2457cf97f5885ced460b20f8f7d17d5c09930e448de42e75b78426cd8e8"'), ('Last-Modified', 'Thu, 08 Apr 2021 14:23:05 GMT'), ('X-OAuth-Scopes', 'admin:org, repo'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4993'), ('X-RateLimit-Reset', '1617895279'), ('X-RateLimit-Used', '7'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'EB48:109EA:37F217:38E505:606F12C0')] +{"url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4","id":611598215,"node_id":"MDExOlB1bGxSZXF1ZXN0NjExNTk4MjE1","html_url":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4","diff_url":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4.diff","patch_url":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4.patch","issue_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/4","number":4,"state":"open","locked":false,"title":"Test commit","user":{"login":"bagashvilit","id":46755932,"node_id":"MDQ6VXNlcjQ2NzU1OTMy","avatar_url":"https://avatars.githubusercontent.com/u/46755932?v=4","gravatar_id":"","url":"https://api.github.com/users/bagashvilit","html_url":"https://github.com/bagashvilit","followers_url":"https://api.github.com/users/bagashvilit/followers","following_url":"https://api.github.com/users/bagashvilit/following{/other_user}","gists_url":"https://api.github.com/users/bagashvilit/gists{/gist_id}","starred_url":"https://api.github.com/users/bagashvilit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagashvilit/subscriptions","organizations_url":"https://api.github.com/users/bagashvilit/orgs","repos_url":"https://api.github.com/users/bagashvilit/repos","events_url":"https://api.github.com/users/bagashvilit/events{/privacy}","received_events_url":"https://api.github.com/users/bagashvilit/received_events","type":"User","site_admin":false},"body":"","created_at":"2021-04-08T14:16:39Z","updated_at":"2021-04-08T14:23:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"07c3d56fa500c0f03a403136ba62cbbec6f148b0","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"draft":false,"commits_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4/commits","review_comments_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4/comments","review_comment_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/4/comments","statuses_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/statuses/a99c92b2ba68464a1a05d7fa8ef55e3a98803e5f","head":{"label":"CS481-Team-Pumpkin:test_delete_pending_review","ref":"test_delete_pending_review","sha":"a99c92b2ba68464a1a05d7fa8ef55e3a98803e5f","user":{"login":"CS481-Team-Pumpkin","id":80543978,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwNTQzOTc4","avatar_url":"https://avatars.githubusercontent.com/u/80543978?v=4","gravatar_id":"","url":"https://api.github.com/users/CS481-Team-Pumpkin","html_url":"https://github.com/CS481-Team-Pumpkin","followers_url":"https://api.github.com/users/CS481-Team-Pumpkin/followers","following_url":"https://api.github.com/users/CS481-Team-Pumpkin/following{/other_user}","gists_url":"https://api.github.com/users/CS481-Team-Pumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/CS481-Team-Pumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS481-Team-Pumpkin/subscriptions","organizations_url":"https://api.github.com/users/CS481-Team-Pumpkin/orgs","repos_url":"https://api.github.com/users/CS481-Team-Pumpkin/repos","events_url":"https://api.github.com/users/CS481-Team-Pumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/CS481-Team-Pumpkin/received_events","type":"Organization","site_admin":false},"repo":{"id":347169081,"node_id":"MDEwOlJlcG9zaXRvcnkzNDcxNjkwODE=","name":"PyGithub","full_name":"CS481-Team-Pumpkin/PyGithub","private":false,"owner":{"login":"CS481-Team-Pumpkin","id":80543978,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwNTQzOTc4","avatar_url":"https://avatars.githubusercontent.com/u/80543978?v=4","gravatar_id":"","url":"https://api.github.com/users/CS481-Team-Pumpkin","html_url":"https://github.com/CS481-Team-Pumpkin","followers_url":"https://api.github.com/users/CS481-Team-Pumpkin/followers","following_url":"https://api.github.com/users/CS481-Team-Pumpkin/following{/other_user}","gists_url":"https://api.github.com/users/CS481-Team-Pumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/CS481-Team-Pumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS481-Team-Pumpkin/subscriptions","organizations_url":"https://api.github.com/users/CS481-Team-Pumpkin/orgs","repos_url":"https://api.github.com/users/CS481-Team-Pumpkin/repos","events_url":"https://api.github.com/users/CS481-Team-Pumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/CS481-Team-Pumpkin/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/CS481-Team-Pumpkin/PyGithub","description":"Typed interactions with the GitHub API v3","fork":true,"url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub","forks_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/forks","keys_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/teams","hooks_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/events","assignees_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/tags","blobs_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/languages","stargazers_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/subscription","commits_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/merges","archive_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/downloads","issues_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/deployments","created_at":"2021-03-12T18:58:51Z","updated_at":"2021-04-02T17:52:24Z","pushed_at":"2021-04-08T14:16:39Z","git_url":"git://github.com/CS481-Team-Pumpkin/PyGithub.git","ssh_url":"git@github.com:CS481-Team-Pumpkin/PyGithub.git","clone_url":"https://github.com/CS481-Team-Pumpkin/PyGithub.git","svn_url":"https://github.com/CS481-Team-Pumpkin/PyGithub","homepage":"https://pygithub.readthedocs.io/","size":13338,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"CS481-Team-Pumpkin:master","ref":"master","sha":"7f0a239bc797a071e512b763dfd3e4339191dc18","user":{"login":"CS481-Team-Pumpkin","id":80543978,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwNTQzOTc4","avatar_url":"https://avatars.githubusercontent.com/u/80543978?v=4","gravatar_id":"","url":"https://api.github.com/users/CS481-Team-Pumpkin","html_url":"https://github.com/CS481-Team-Pumpkin","followers_url":"https://api.github.com/users/CS481-Team-Pumpkin/followers","following_url":"https://api.github.com/users/CS481-Team-Pumpkin/following{/other_user}","gists_url":"https://api.github.com/users/CS481-Team-Pumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/CS481-Team-Pumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS481-Team-Pumpkin/subscriptions","organizations_url":"https://api.github.com/users/CS481-Team-Pumpkin/orgs","repos_url":"https://api.github.com/users/CS481-Team-Pumpkin/repos","events_url":"https://api.github.com/users/CS481-Team-Pumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/CS481-Team-Pumpkin/received_events","type":"Organization","site_admin":false},"repo":{"id":347169081,"node_id":"MDEwOlJlcG9zaXRvcnkzNDcxNjkwODE=","name":"PyGithub","full_name":"CS481-Team-Pumpkin/PyGithub","private":false,"owner":{"login":"CS481-Team-Pumpkin","id":80543978,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgwNTQzOTc4","avatar_url":"https://avatars.githubusercontent.com/u/80543978?v=4","gravatar_id":"","url":"https://api.github.com/users/CS481-Team-Pumpkin","html_url":"https://github.com/CS481-Team-Pumpkin","followers_url":"https://api.github.com/users/CS481-Team-Pumpkin/followers","following_url":"https://api.github.com/users/CS481-Team-Pumpkin/following{/other_user}","gists_url":"https://api.github.com/users/CS481-Team-Pumpkin/gists{/gist_id}","starred_url":"https://api.github.com/users/CS481-Team-Pumpkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CS481-Team-Pumpkin/subscriptions","organizations_url":"https://api.github.com/users/CS481-Team-Pumpkin/orgs","repos_url":"https://api.github.com/users/CS481-Team-Pumpkin/repos","events_url":"https://api.github.com/users/CS481-Team-Pumpkin/events{/privacy}","received_events_url":"https://api.github.com/users/CS481-Team-Pumpkin/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/CS481-Team-Pumpkin/PyGithub","description":"Typed interactions with the GitHub API v3","fork":true,"url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub","forks_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/forks","keys_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/teams","hooks_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/events","assignees_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/tags","blobs_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/languages","stargazers_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/subscription","commits_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/comments{/number}","contents_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/merges","archive_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/downloads","issues_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/releases{/id}","deployments_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/deployments","created_at":"2021-03-12T18:58:51Z","updated_at":"2021-04-02T17:52:24Z","pushed_at":"2021-04-08T14:16:39Z","git_url":"git://github.com/CS481-Team-Pumpkin/PyGithub.git","ssh_url":"git@github.com:CS481-Team-Pumpkin/PyGithub.git","clone_url":"https://github.com/CS481-Team-Pumpkin/PyGithub.git","svn_url":"https://github.com/CS481-Team-Pumpkin/PyGithub","homepage":"https://pygithub.readthedocs.io/","size":13338,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":3,"license":{"key":"lgpl-3.0","name":"GNU Lesser General Public License v3.0","spdx_id":"LGPL-3.0","url":"https://api.github.com/licenses/lgpl-3.0","node_id":"MDc6TGljZW5zZTEy"},"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4"},"html":{"href":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4"},"issue":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/4"},"comments":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/statuses/a99c92b2ba68464a1a05d7fa8ef55e3a98803e5f"}},"author_association":"MEMBER","auto_merge":null,"active_lock_reason":null,"merged":false,"mergeable":true,"rebaseable":true,"mergeable_state":"clean","merged_by":null,"comments":0,"review_comments":1,"maintainer_can_modify":false,"commits":1,"additions":1,"deletions":0,"changed_files":1} + +https +GET +api.github.com +None +/repos/CS481-Team-Pumpkin/PyGithub/pulls/4/reviews/631460061 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 08 Apr 2021 14:27:13 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"2cb2134a474a60fa86391e682a41332b9ce4e92e41b9e7d2039ce2e6c64ae80e"'), ('X-OAuth-Scopes', 'admin:org, repo'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4992'), ('X-RateLimit-Reset', '1617895279'), ('X-RateLimit-Used', '8'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'EB4A:950E:125F8E:13037F:606F12C0')] +{"id":631460061,"node_id":"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3NjMxNDYwMDYx","user":{"login":"bagashvilit","id":46755932,"node_id":"MDQ6VXNlcjQ2NzU1OTMy","avatar_url":"https://avatars.githubusercontent.com/u/46755932?v=4","gravatar_id":"","url":"https://api.github.com/users/bagashvilit","html_url":"https://github.com/bagashvilit","followers_url":"https://api.github.com/users/bagashvilit/followers","following_url":"https://api.github.com/users/bagashvilit/following{/other_user}","gists_url":"https://api.github.com/users/bagashvilit/gists{/gist_id}","starred_url":"https://api.github.com/users/bagashvilit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagashvilit/subscriptions","organizations_url":"https://api.github.com/users/bagashvilit/orgs","repos_url":"https://api.github.com/users/bagashvilit/repos","events_url":"https://api.github.com/users/bagashvilit/events{/privacy}","received_events_url":"https://api.github.com/users/bagashvilit/received_events","type":"User","site_admin":false},"body":"","state":"PENDING","html_url":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4#pullrequestreview-631460061","pull_request_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4","author_association":"MEMBER","_links":{"html":{"href":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4#pullrequestreview-631460061"},"pull_request":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4"}},"commit_id":"a99c92b2ba68464a1a05d7fa8ef55e3a98803e5f"} + diff --git a/tests/ReplayData/PullRequestReview1856.testDelete.txt b/tests/ReplayData/PullRequestReview1856.testDelete.txt new file mode 100644 index 0000000000..47bb025c03 --- /dev/null +++ b/tests/ReplayData/PullRequestReview1856.testDelete.txt @@ -0,0 +1,22 @@ +https +DELETE +api.github.com +None +/repos/CS481-Team-Pumpkin/PyGithub/pulls/4/reviews/631460061 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 08 Apr 2021 14:27:14 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Transfer-Encoding', 'chunked'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', 'W/"2cb2134a474a60fa86391e682a41332b9ce4e92e41b9e7d2039ce2e6c64ae80e"'), ('X-OAuth-Scopes', 'admin:org, repo'), ('X-Accepted-OAuth-Scopes', 'public_repo, repo'), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4991'), ('X-RateLimit-Reset', '1617895279'), ('X-RateLimit-Used', '9'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('Content-Encoding', 'gzip'), ('X-GitHub-Request-Id', 'EB4C:74D7:85110:8A249:606F12C1')] +{"id":631460061,"node_id":"MDE3OlB1bGxSZXF1ZXN0UmV2aWV3NjMxNDYwMDYx","user":{"login":"bagashvilit","id":46755932,"node_id":"MDQ6VXNlcjQ2NzU1OTMy","avatar_url":"https://avatars.githubusercontent.com/u/46755932?v=4","gravatar_id":"","url":"https://api.github.com/users/bagashvilit","html_url":"https://github.com/bagashvilit","followers_url":"https://api.github.com/users/bagashvilit/followers","following_url":"https://api.github.com/users/bagashvilit/following{/other_user}","gists_url":"https://api.github.com/users/bagashvilit/gists{/gist_id}","starred_url":"https://api.github.com/users/bagashvilit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bagashvilit/subscriptions","organizations_url":"https://api.github.com/users/bagashvilit/orgs","repos_url":"https://api.github.com/users/bagashvilit/repos","events_url":"https://api.github.com/users/bagashvilit/events{/privacy}","received_events_url":"https://api.github.com/users/bagashvilit/received_events","type":"User","site_admin":false},"body":"","state":"PENDING","html_url":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4#pullrequestreview-631460061","pull_request_url":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4","author_association":"MEMBER","_links":{"html":{"href":"https://github.com/CS481-Team-Pumpkin/PyGithub/pull/4#pullrequestreview-631460061"},"pull_request":{"href":"https://api.github.com/repos/CS481-Team-Pumpkin/PyGithub/pulls/4"}},"commit_id":"a99c92b2ba68464a1a05d7fa8ef55e3a98803e5f"} + +https +GET +api.github.com +None +/repos/CS481-Team-Pumpkin/PyGithub/pulls/4/reviews +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +None +200 +[('Server', 'GitHub.com'), ('Date', 'Thu, 08 Apr 2021 14:27:14 GMT'), ('Content-Type', 'application/json; charset=utf-8'), ('Content-Length', '2'), ('Cache-Control', 'private, max-age=60, s-maxage=60'), ('Vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding, Accept, X-Requested-With'), ('ETag', '"82184cd6a599c0bb646629f3cbc867fb158314f97d57df6e35f0e910ed328f22"'), ('X-OAuth-Scopes', 'admin:org, repo'), ('X-Accepted-OAuth-Scopes', ''), ('X-GitHub-Media-Type', 'github.v3; format=json'), ('X-RateLimit-Limit', '5000'), ('X-RateLimit-Remaining', '4990'), ('X-RateLimit-Reset', '1617895279'), ('X-RateLimit-Used', '10'), ('Access-Control-Expose-Headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset'), ('Access-Control-Allow-Origin', '*'), ('Strict-Transport-Security', 'max-age=31536000; includeSubdomains; preload'), ('X-Frame-Options', 'deny'), ('X-Content-Type-Options', 'nosniff'), ('X-XSS-Protection', '0'), ('Referrer-Policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('Content-Security-Policy', "default-src 'none'"), ('X-GitHub-Request-Id', 'EB4E:109E6:83D8B:8CA9B:606F12C2')] +[] +