git webhooks: Handle assignment events better.

With the introduction of `assignee_updated` parameter in the library,
- Github, Gitea, Gogs can display the assignee in assignment events.
- Github can display the user unassigned in unassignment events.

Fixes https://chat.zulip.org/#narrow/channel/127-integrations/near/1965136
This commit is contained in:
Niloth P
2024-10-24 07:26:41 +05:30
committed by Tim Abbott
parent 8e85972a03
commit bd83dbfb42
7 changed files with 41 additions and 40 deletions

View File

@@ -53,7 +53,7 @@ class GiteaHookTests(WebhookTestCase):
def test_pull_request_assigned(self) -> None:
expected_topic_name = "test / PR #1906 test 2"
expected_message = """kostekIV assigned [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) from `d` to `master` (assigned to kostekIV)."""
expected_message = """kostekIV assigned kostekIV to [PR #5](https://try.gitea.io/kostekIV/test/pulls/5) from `d` to `master` (assigned to kostekIV)."""
self.check_webhook("pull_request__assigned", expected_topic_name, expected_message)
def test_issues_opened(self) -> None:
@@ -73,7 +73,7 @@ class GiteaHookTests(WebhookTestCase):
def test_issues_assigned(self) -> None:
expected_topic_name = "test / issue #3 Test issue"
expected_message = """kostekIV assigned [issue #3](https://try.gitea.io/kostekIV/test/issues/3) (assigned to kostekIV):\n\n~~~ quote\nTest body\n~~~"""
expected_message = """kostekIV assigned kostekIV to [issue #3](https://try.gitea.io/kostekIV/test/issues/3) (assigned to kostekIV):\n\n~~~ quote\nTest body\n~~~"""
self.check_webhook("issues__assigned", expected_topic_name, expected_message)
def test_issues_reopened(self) -> None: