mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 03:41:58 +00:00
@@ -479,6 +479,7 @@ exports.fixtures = {
|
|||||||
|
|
||||||
restart: {
|
restart: {
|
||||||
type: "restart",
|
type: "restart",
|
||||||
|
server_generation: 2,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1085,6 +1085,11 @@ def check_realm_user_update(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
restart_event = event_dict_type(
|
||||||
|
required_keys=[("type", Equals("restart")), ("server_generation", int), ("immediate", bool)]
|
||||||
|
)
|
||||||
|
check_restart_event = make_checker(restart_event)
|
||||||
|
|
||||||
stream_create_event = event_dict_type(
|
stream_create_event = event_dict_type(
|
||||||
required_keys=[
|
required_keys=[
|
||||||
("type", Equals("stream")),
|
("type", Equals("stream")),
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from django.conf import settings
|
|||||||
from django.http import HttpRequest, HttpResponse
|
from django.http import HttpRequest, HttpResponse
|
||||||
|
|
||||||
from zerver.lib.actions import check_send_message, do_change_user_role, do_set_realm_property
|
from zerver.lib.actions import check_send_message, do_change_user_role, do_set_realm_property
|
||||||
|
from zerver.lib.event_schema import check_restart_event
|
||||||
from zerver.lib.events import fetch_initial_state_data, get_raw_user_data
|
from zerver.lib.events import fetch_initial_state_data, get_raw_user_data
|
||||||
from zerver.lib.test_classes import ZulipTestCase
|
from zerver.lib.test_classes import ZulipTestCase
|
||||||
from zerver.lib.test_helpers import HostRequestMock, queries_captured, stub_event_queue_user_events
|
from zerver.lib.test_helpers import HostRequestMock, queries_captured, stub_event_queue_user_events
|
||||||
@@ -816,9 +817,7 @@ class RestartEventsTest(ZulipTestCase):
|
|||||||
self.assertEqual(len(virtual_events), 1)
|
self.assertEqual(len(virtual_events), 1)
|
||||||
restart_event = virtual_events["restart"]
|
restart_event = virtual_events["restart"]
|
||||||
|
|
||||||
# TODO: add a schema checker for this to event_schema.py
|
check_restart_event("restart_event", restart_event)
|
||||||
# and exercise it here (as well as the more concrete
|
|
||||||
# check)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
restart_event,
|
restart_event,
|
||||||
dict(
|
dict(
|
||||||
|
|||||||
Reference in New Issue
Block a user