mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
test_event_queue: Introduce helper to fill-up default values.
This allows us to only mention the values that are relevant to the behavior being tested by the `check_notify` function in the current assertion.
This commit is contained in:
committed by
Tim Abbott
parent
8eec7b4718
commit
d9395e7b52
@@ -1292,6 +1292,27 @@ Output:
|
||||
|
||||
self.assert_length(lst, expected_num_events)
|
||||
|
||||
def get_maybe_enqueue_notifications_parameters(self, **kwargs: Any) -> Dict[str, Any]:
|
||||
"""
|
||||
Returns a dictionary with the passed parameters, after filling up the
|
||||
missing data with default values, for testing what was passed to the
|
||||
`maybe_enqueue_notifications` method.
|
||||
"""
|
||||
parameters: Dict[str, Any] = dict(
|
||||
private_message=False,
|
||||
mentioned=False,
|
||||
wildcard_mention_notify=False,
|
||||
stream_push_notify=False,
|
||||
stream_email_notify=False,
|
||||
stream_name=None,
|
||||
online_push_enabled=False,
|
||||
idle=True,
|
||||
already_notified={"email_notified": False, "push_notified": False},
|
||||
)
|
||||
|
||||
# Values from `kwargs` will replace those from `parameters`
|
||||
return {**parameters, **kwargs}
|
||||
|
||||
|
||||
class WebhookTestCase(ZulipTestCase):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user