Files
PIG208 5ecbfecd77 webhook: Rename FIXTURE_DIR_NAME to WEBHOOK_DIR_NAME.
Since FIXTURE_DIR_NAME is the name of the folder that contains the view
and tests modules of the webhook and another folder called "fixtures" that
store the fixtures, it is more appropriate to call it WEBHOOK_DIR_NAME,
especially when we want to refer to the view module using this variable.
2021-06-29 17:01:54 -07:00

20 lines
816 B
Python

from zerver.lib.test_classes import WebhookTestCase
class CrashlyticsHookTests(WebhookTestCase):
STREAM_NAME = "crashlytics"
URL_TEMPLATE = "/api/v1/external/crashlytics?stream={stream}&api_key={api_key}"
WEBHOOK_DIR_NAME = "crashlytics"
def test_crashlytics_verification_message(self) -> None:
expected_topic = "Setup"
expected_message = "Webhook has been successfully configured."
self.check_webhook("verification", expected_topic, expected_message)
def test_crashlytics_build_in_success_status(self) -> None:
expected_topic = "123: Issue Title"
expected_message = (
"[Issue](http://crashlytics.com/full/url/to/issue) impacts at least 16 device(s)."
)
self.check_webhook("issue_message", expected_topic, expected_message)