Files
zulip/zerver/webhooks/yo/tests.py
Anders Kaseorg c734bbd95d python: Modernize legacy Python 2 syntax with pyupgrade.
Generated by `pyupgrade --py3-plus --keep-percent-format` on all our
Python code except `zthumbor` and `zulip-ec2-configure-interfaces`,
followed by manual indentation fixes.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2020-04-09 16:43:22 -07:00

27 lines
873 B
Python

from typing import Any, Dict
from zerver.lib.test_classes import WebhookTestCase
class YoHookTests(WebhookTestCase):
STREAM_NAME = 'yo'
URL_TEMPLATE = "/api/v1/external/yo?api_key={api_key}"
FIXTURE_DIR_NAME = 'yo'
def test_yo_message(self) -> None:
"""
Yo App sends notification whenever user receives a new Yo from another user.
"""
cordelia = self.example_user('cordelia')
self.url = self.build_webhook_url(
email=cordelia.email,
username="IAGO",
user_ip="127.0.0.1"
)
expected_message = "Yo from IAGO"
self.send_and_test_private_message('', expected_message=expected_message,
content_type="application/x-www-form-urlencoded")
def get_body(self, fixture_name: str) -> Dict[str, Any]:
return {}