Files
zulip/zerver/tests/test_url_decoding.py
Prakhar Pratyush 484befe9ce url_decoding: Add 'is_same_server_message_link' function.
This prep commit adds a lib function 'is_same_server_message_link'.

This will be currently used while compressing quote and reply
in push notifications and later can be used at other places.
2024-06-17 10:42:32 -07:00

14 lines
465 B
Python

import orjson
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.url_decoding import is_same_server_message_link
class URLDecodeTest(ZulipTestCase):
def test_is_same_server_message_link(self) -> None:
tests = orjson.loads(self.fixture_data("message_link_test_cases.json"))
for test in tests:
self.assertEqual(
is_same_server_message_link(test["message_link"]), test["expected_output"]
)