2016-09-20 22:51:11 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
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 SentryHookTests(WebhookTestCase):
|
|
|
|
STREAM_NAME = 'sentry'
|
2018-03-16 22:53:50 +01:00
|
|
|
URL_TEMPLATE = "/api/v1/external/sentry?&api_key={api_key}&stream={stream}"
|
2016-09-20 22:51:11 +02:00
|
|
|
FIXTURE_DIR_NAME = 'sentry'
|
|
|
|
|
2017-11-04 07:47:46 +01:00
|
|
|
def test_error_issue_message(self) -> None:
|
2018-11-09 20:33:58 +01:00
|
|
|
expected_topic = u"zulip"
|
2019-04-17 23:09:05 +02:00
|
|
|
expected_message = """
|
|
|
|
New [issue](https://sentry.io/zulip/zulip/issues/156699934/) (level: ERROR):
|
|
|
|
|
|
|
|
``` quote
|
|
|
|
This is an example python exception
|
|
|
|
```
|
|
|
|
""".strip()
|
|
|
|
|
2016-09-20 22:51:11 +02:00
|
|
|
self.send_and_test_stream_message(
|
|
|
|
'exception_message',
|
2018-11-09 20:33:58 +01:00
|
|
|
expected_topic,
|
2016-09-20 22:51:11 +02:00
|
|
|
expected_message
|
|
|
|
)
|