webhooks/github: Be more explicit about unsupported PR events.

This was technically a bug. For events that aren't unsupported
intentionally, the control should fall to the line that raises
UnknownWebhookEventType, and shouldn't be handled by anything else.

The events that are intentionally unsupported should be handled
more explicitly.
This commit is contained in:
Eeshan Garg
2018-07-01 14:59:45 -02:30
committed by Tim Abbott
parent 2673a7f71f
commit 04ed123214
2 changed files with 3 additions and 10 deletions

View File

@@ -224,14 +224,6 @@ class GithubWebhookTest(WebhookTestCase):
self.assertFalse(check_send_webhook_message_mock.called)
self.assert_json_success(result)
@patch('zerver.webhooks.github.view.check_send_webhook_message')
def test_pull_request_request_review_ignore(
self, check_send_webhook_message_mock: MagicMock) -> None:
payload = self.get_body('request_review_pull_request')
result = self.client_post(self.url, payload, HTTP_X_GITHUB_EVENT='pull_request', content_type="application/json")
self.assertFalse(check_send_webhook_message_mock.called)
self.assert_json_success(result)
@patch('zerver.webhooks.github.view.check_send_webhook_message')
def test_pull_request_request_review_remove_ignore(
self, check_send_webhook_message_mock: MagicMock) -> None: