2016-11-10 19:30:09 +01:00
|
|
|
from zerver.lib.test_classes import WebhookTestCase
|
2016-09-20 22:51:11 +02:00
|
|
|
|
2020-01-14 22:06:24 +01:00
|
|
|
|
2016-09-20 22:51:11 +02:00
|
|
|
class CrashlyticsHookTests(WebhookTestCase):
|
2021-02-12 08:20:45 +01:00
|
|
|
STREAM_NAME = "crashlytics"
|
2020-04-09 21:51:58 +02:00
|
|
|
URL_TEMPLATE = "/api/v1/external/crashlytics?stream={stream}&api_key={api_key}"
|
2021-06-26 09:18:33 +02:00
|
|
|
WEBHOOK_DIR_NAME = "crashlytics"
|
2016-09-20 22:51:11 +02:00
|
|
|
|
2017-11-04 07:47:46 +01:00
|
|
|
def test_crashlytics_verification_message(self) -> None:
|
2024-01-17 15:53:30 +01:00
|
|
|
expected_topic_name = "Setup"
|
2020-04-09 21:51:58 +02:00
|
|
|
expected_message = "Webhook has been successfully configured."
|
2024-01-17 15:53:30 +01:00
|
|
|
self.check_webhook("verification", expected_topic_name, expected_message)
|
2016-09-20 22:51:11 +02:00
|
|
|
|
2017-11-04 07:47:46 +01:00
|
|
|
def test_crashlytics_build_in_success_status(self) -> None:
|
2024-01-17 15:53:30 +01:00
|
|
|
expected_topic_name = "123: Issue Title"
|
2021-02-12 08:19:30 +01:00
|
|
|
expected_message = (
|
|
|
|
"[Issue](http://crashlytics.com/full/url/to/issue) impacts at least 16 device(s)."
|
|
|
|
)
|
2024-01-17 15:53:30 +01:00
|
|
|
self.check_webhook("issue_message", expected_topic_name, expected_message)
|