mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 16:43:57 +00:00
integrations: Add pull request comment fixture to GitHub Integration.
Updated the repo name and pull request number/title for the new pull request commit fixture to be the same as the one used for the other pull request test fixtures (e.g. pull_request__opened) so that the TOPIC_PR can be used in the subsequent updates. Co-authored-by: Lauryn Menard <lauryn@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
9eeeabf877
commit
7ebf572b8e
@@ -0,0 +1,235 @@
|
||||
{
|
||||
"action": "created",
|
||||
"issue": {
|
||||
"url": "https://api.github.com/repos/sbansal1999/public-repo/issues/1",
|
||||
"repository_url": "https://api.github.com/repos/sbansal1999/public-repo",
|
||||
"labels_url": "https://api.github.com/repos/sbansal1999/public-repo/issues/1/labels{/name}",
|
||||
"comments_url": "https://api.github.com/repos/sbansal1999/public-repo/issues/1/comments",
|
||||
"events_url": "https://api.github.com/repos/sbansal1999/public-repo/issues/1/events",
|
||||
"html_url": "https://github.com/sbansal1999/public-repo/pull/1",
|
||||
"id": 1799681822,
|
||||
"node_id": "PR_kwDOJRp_V85VPfLc",
|
||||
"number": 1,
|
||||
"title": "Update the README with new information",
|
||||
"user": {
|
||||
"login": "sbansal1999",
|
||||
"id": 35286603,
|
||||
"node_id": "MDQ6VXNlcjM1Mjg2NjAz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/35286603?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/sbansal1999",
|
||||
"html_url": "https://github.com/sbansal1999",
|
||||
"followers_url": "https://api.github.com/users/sbansal1999/followers",
|
||||
"following_url": "https://api.github.com/users/sbansal1999/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/sbansal1999/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/sbansal1999/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/sbansal1999/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/sbansal1999/orgs",
|
||||
"repos_url": "https://api.github.com/users/sbansal1999/repos",
|
||||
"events_url": "https://api.github.com/users/sbansal1999/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/sbansal1999/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"labels": [],
|
||||
"state": "open",
|
||||
"locked": false,
|
||||
"assignee": null,
|
||||
"assignees": [],
|
||||
"milestone": null,
|
||||
"comments": 1,
|
||||
"created_at": "2023-07-11T20:10:07Z",
|
||||
"updated_at": "2023-07-11T20:10:13Z",
|
||||
"closed_at": null,
|
||||
"author_association": "OWNER",
|
||||
"active_lock_reason": null,
|
||||
"draft": false,
|
||||
"pull_request": {
|
||||
"url": "https://api.github.com/repos/sbansal1999/public-repo/pulls/1",
|
||||
"html_url": "https://github.com/sbansal1999/public-repo/pull/1",
|
||||
"diff_url": "https://github.com/sbansal1999/public-repo/pull/1.diff",
|
||||
"patch_url": "https://github.com/sbansal1999/public-repo/pull/1.patch",
|
||||
"merged_at": null
|
||||
},
|
||||
"body": null,
|
||||
"reactions": {
|
||||
"url": "https://api.github.com/repos/sbansal1999/public-repo/issues/1/reactions",
|
||||
"total_count": 0,
|
||||
"+1": 0,
|
||||
"-1": 0,
|
||||
"laugh": 0,
|
||||
"hooray": 0,
|
||||
"confused": 0,
|
||||
"heart": 0,
|
||||
"rocket": 0,
|
||||
"eyes": 0
|
||||
},
|
||||
"timeline_url": "https://api.github.com/repos/sbansal1999/public-repo/issues/1/timeline",
|
||||
"performed_via_github_app": null,
|
||||
"state_reason": null
|
||||
},
|
||||
"comment": {
|
||||
"url": "https://api.github.com/repos/sbansal1999/public-repo/issues/comments/1631445420",
|
||||
"html_url": "https://github.com/sbansal1999/public-repo/pull/1#issuecomment-1631445420",
|
||||
"issue_url": "https://api.github.com/repos/sbansal1999/public-repo/issues/1",
|
||||
"id": 1631445420,
|
||||
"node_id": "IC_kwDOJRp_V85hPeGs",
|
||||
"user": {
|
||||
"login": "sbansal1999",
|
||||
"id": 35286603,
|
||||
"node_id": "MDQ6VXNlcjM1Mjg2NjAz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/35286603?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/sbansal1999",
|
||||
"html_url": "https://github.com/sbansal1999",
|
||||
"followers_url": "https://api.github.com/users/sbansal1999/followers",
|
||||
"following_url": "https://api.github.com/users/sbansal1999/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/sbansal1999/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/sbansal1999/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/sbansal1999/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/sbansal1999/orgs",
|
||||
"repos_url": "https://api.github.com/users/sbansal1999/repos",
|
||||
"events_url": "https://api.github.com/users/sbansal1999/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/sbansal1999/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"created_at": "2023-07-11T20:10:12Z",
|
||||
"updated_at": "2023-07-11T20:10:12Z",
|
||||
"author_association": "OWNER",
|
||||
"body": "Some comment",
|
||||
"reactions": {
|
||||
"url": "https://api.github.com/repos/sbansal1999/public-repo/issues/comments/1631445420/reactions",
|
||||
"total_count": 0,
|
||||
"+1": 0,
|
||||
"-1": 0,
|
||||
"laugh": 0,
|
||||
"hooray": 0,
|
||||
"confused": 0,
|
||||
"heart": 0,
|
||||
"rocket": 0,
|
||||
"eyes": 0
|
||||
},
|
||||
"performed_via_github_app": null
|
||||
},
|
||||
"repository": {
|
||||
"id": 622493527,
|
||||
"node_id": "R_kgDOJRp_Vw",
|
||||
"name": "public-repo",
|
||||
"full_name": "sbansal1999/public-repo",
|
||||
"private": false,
|
||||
"owner": {
|
||||
"login": "sbansal1999",
|
||||
"id": 35286603,
|
||||
"node_id": "MDQ6VXNlcjM1Mjg2NjAz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/35286603?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/sbansal1999",
|
||||
"html_url": "https://github.com/sbansal1999",
|
||||
"followers_url": "https://api.github.com/users/sbansal1999/followers",
|
||||
"following_url": "https://api.github.com/users/sbansal1999/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/sbansal1999/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/sbansal1999/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/sbansal1999/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/sbansal1999/orgs",
|
||||
"repos_url": "https://api.github.com/users/sbansal1999/repos",
|
||||
"events_url": "https://api.github.com/users/sbansal1999/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/sbansal1999/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
},
|
||||
"html_url": "https://github.com/sbansal1999/public-repo",
|
||||
"description": null,
|
||||
"fork": false,
|
||||
"url": "https://api.github.com/repos/sbansal1999/public-repo",
|
||||
"forks_url": "https://api.github.com/repos/sbansal1999/public-repo/forks",
|
||||
"keys_url": "https://api.github.com/repos/sbansal1999/public-repo/keys{/key_id}",
|
||||
"collaborators_url": "https://api.github.com/repos/sbansal1999/public-repo/collaborators{/collaborator}",
|
||||
"teams_url": "https://api.github.com/repos/sbansal1999/public-repo/teams",
|
||||
"hooks_url": "https://api.github.com/repos/sbansal1999/public-repo/hooks",
|
||||
"issue_events_url": "https://api.github.com/repos/sbansal1999/public-repo/issues/events{/number}",
|
||||
"events_url": "https://api.github.com/repos/sbansal1999/public-repo/events",
|
||||
"assignees_url": "https://api.github.com/repos/sbansal1999/public-repo/assignees{/user}",
|
||||
"branches_url": "https://api.github.com/repos/sbansal1999/public-repo/branches{/branch}",
|
||||
"tags_url": "https://api.github.com/repos/sbansal1999/public-repo/tags",
|
||||
"blobs_url": "https://api.github.com/repos/sbansal1999/public-repo/git/blobs{/sha}",
|
||||
"git_tags_url": "https://api.github.com/repos/sbansal1999/public-repo/git/tags{/sha}",
|
||||
"git_refs_url": "https://api.github.com/repos/sbansal1999/public-repo/git/refs{/sha}",
|
||||
"trees_url": "https://api.github.com/repos/sbansal1999/public-repo/git/trees{/sha}",
|
||||
"statuses_url": "https://api.github.com/repos/sbansal1999/public-repo/statuses/{sha}",
|
||||
"languages_url": "https://api.github.com/repos/sbansal1999/public-repo/languages",
|
||||
"stargazers_url": "https://api.github.com/repos/sbansal1999/public-repo/stargazers",
|
||||
"contributors_url": "https://api.github.com/repos/sbansal1999/public-repo/contributors",
|
||||
"subscribers_url": "https://api.github.com/repos/sbansal1999/public-repo/subscribers",
|
||||
"subscription_url": "https://api.github.com/repos/sbansal1999/public-repo/subscription",
|
||||
"commits_url": "https://api.github.com/repos/sbansal1999/public-repo/commits{/sha}",
|
||||
"git_commits_url": "https://api.github.com/repos/sbansal1999/public-repo/git/commits{/sha}",
|
||||
"comments_url": "https://api.github.com/repos/sbansal1999/public-repo/comments{/number}",
|
||||
"issue_comment_url": "https://api.github.com/repos/sbansal1999/public-repo/issues/comments{/number}",
|
||||
"contents_url": "https://api.github.com/repos/sbansal1999/public-repo/contents/{+path}",
|
||||
"compare_url": "https://api.github.com/repos/sbansal1999/public-repo/compare/{base}...{head}",
|
||||
"merges_url": "https://api.github.com/repos/sbansal1999/public-repo/merges",
|
||||
"archive_url": "https://api.github.com/repos/sbansal1999/public-repo/{archive_format}{/ref}",
|
||||
"downloads_url": "https://api.github.com/repos/sbansal1999/public-repo/downloads",
|
||||
"issues_url": "https://api.github.com/repos/sbansal1999/public-repo/issues{/number}",
|
||||
"pulls_url": "https://api.github.com/repos/sbansal1999/public-repo/pulls{/number}",
|
||||
"milestones_url": "https://api.github.com/repos/sbansal1999/public-repo/milestones{/number}",
|
||||
"notifications_url": "https://api.github.com/repos/sbansal1999/public-repo/notifications{?since,all,participating}",
|
||||
"labels_url": "https://api.github.com/repos/sbansal1999/public-repo/labels{/name}",
|
||||
"releases_url": "https://api.github.com/repos/sbansal1999/public-repo/releases{/id}",
|
||||
"deployments_url": "https://api.github.com/repos/sbansal1999/public-repo/deployments",
|
||||
"created_at": "2023-04-02T09:31:40Z",
|
||||
"updated_at": "2023-07-09T17:15:18Z",
|
||||
"pushed_at": "2023-07-11T20:10:07Z",
|
||||
"git_url": "git://github.com/sbansal1999/public-repo.git",
|
||||
"ssh_url": "git@github.com:sbansal1999/public-repo.git",
|
||||
"clone_url": "https://github.com/sbansal1999/public-repo.git",
|
||||
"svn_url": "https://github.com/sbansal1999/public-repo",
|
||||
"homepage": null,
|
||||
"size": 3,
|
||||
"stargazers_count": 0,
|
||||
"watchers_count": 0,
|
||||
"language": null,
|
||||
"has_issues": true,
|
||||
"has_projects": true,
|
||||
"has_downloads": true,
|
||||
"has_wiki": true,
|
||||
"has_pages": false,
|
||||
"has_discussions": true,
|
||||
"forks_count": 0,
|
||||
"mirror_url": null,
|
||||
"archived": false,
|
||||
"disabled": false,
|
||||
"open_issues_count": 7,
|
||||
"license": null,
|
||||
"allow_forking": true,
|
||||
"is_template": false,
|
||||
"web_commit_signoff_required": false,
|
||||
"topics": [],
|
||||
"visibility": "public",
|
||||
"forks": 0,
|
||||
"open_issues": 7,
|
||||
"watchers": 0,
|
||||
"default_branch": "fixing-typo"
|
||||
},
|
||||
"sender": {
|
||||
"login": "sbansal1999",
|
||||
"id": 35286603,
|
||||
"node_id": "MDQ6VXNlcjM1Mjg2NjAz",
|
||||
"avatar_url": "https://avatars.githubusercontent.com/u/35286603?v=4",
|
||||
"gravatar_id": "",
|
||||
"url": "https://api.github.com/users/sbansal1999",
|
||||
"html_url": "https://github.com/sbansal1999",
|
||||
"followers_url": "https://api.github.com/users/sbansal1999/followers",
|
||||
"following_url": "https://api.github.com/users/sbansal1999/following{/other_user}",
|
||||
"gists_url": "https://api.github.com/users/sbansal1999/gists{/gist_id}",
|
||||
"starred_url": "https://api.github.com/users/sbansal1999/starred{/owner}{/repo}",
|
||||
"subscriptions_url": "https://api.github.com/users/sbansal1999/subscriptions",
|
||||
"organizations_url": "https://api.github.com/users/sbansal1999/orgs",
|
||||
"repos_url": "https://api.github.com/users/sbansal1999/repos",
|
||||
"events_url": "https://api.github.com/users/sbansal1999/events{/privacy}",
|
||||
"received_events_url": "https://api.github.com/users/sbansal1999/received_events",
|
||||
"type": "User",
|
||||
"site_admin": false
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,11 @@ class GitHubWebhookTest(WebhookTestCase):
|
||||
expected_message = "baxterthehacker [commented](https://github.com/baxterthehacker/public-repo/issues/2#issuecomment-99262140) on [issue #2 Spelling error in the README file](https://github.com/baxterthehacker/public-repo/issues/2):\n\n~~~ quote\nYou are totally right! I'll get this fixed right away.\n~~~"
|
||||
self.check_webhook("issue_comment", expected_topic, expected_message)
|
||||
|
||||
def test_issue_comment_pull_request_comment_msg(self) -> None:
|
||||
expected_topic = "public-repo / issue #1 Update the README with new informa..."
|
||||
expected_message = "sbansal1999 [commented](https://github.com/sbansal1999/public-repo/pull/1#issuecomment-1631445420) on [issue #1](https://github.com/sbansal1999/public-repo/pull/1):\n\n~~~ quote\nSome comment\n~~~"
|
||||
self.check_webhook("issue_comment__pull_request_comment", expected_topic, expected_message)
|
||||
|
||||
def test_issue_msg(self) -> None:
|
||||
expected_message = "baxterthehacker opened [issue #2](https://github.com/baxterthehacker/public-repo/issues/2):\n\n~~~ quote\nIt looks like you accidentally spelled 'commit' with two 't's.\n~~~"
|
||||
self.check_webhook("issues", TOPIC_ISSUE, expected_message)
|
||||
|
||||
Reference in New Issue
Block a user