Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

tests: Use check_tuple for realm filters.

Steve Howellde2285222d22
diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.py
index b0ae35709b6..1287cd1509f 100644
--- a/zerver/tests/test_events.py
+++ b/zerver/tests/test_events.py
@@ -2027,12 +2027,18 @@ class EventsRegisterTest(ZulipTestCase):
schema_checker('events[0]', events[0])
def test_realm_filter_events(self) -> None:
+ regex = "#(?P<id>[123])"
+ url = "https://realm.com/my_realm_filter/%(id)s"
+
schema_checker = self.check_events_dict([
('type', equals('realm_filters')),
- ('realm_filters', check_list(None)), # TODO: validate tuples in the list
+ ('realm_filters', check_list(check_tuple([
+ check_string,
+ check_string,
+ check_int,
+ ]))),
])
- events = self.do_test(lambda: do_add_realm_filter(self.user_profile.realm, "#(?P<id>[123])",
- "https://realm.com/my_realm_filter/%(id)s"))
+ events = self.do_test(lambda: do_add_realm_filter(self.user_profile.realm, regex, url))
schema_checker('events[0]', events[0])
events = self.do_test(lambda: do_remove_realm_filter(self.user_profile.realm, "#(?P<id>[123])"))