1
0
Files
synapse/tests/rest/client/test_sliding_sync.py
2024-05-09 15:11:27 -05:00

30 lines
1.3 KiB
Python

from twisted.test.proto_helpers import MemoryReactor
from synapse.server import HomeServer
from synapse.types import JsonDict
from synapse.util import Clock
# TODO: Uncomment this line when we have a pattern to share tests across files, see
# https://github.com/element-hq/synapse/pull/17167#discussion_r1594517041
#
# from tests.rest.client.test_sync import DeviceListSyncTestCase
# from tests.rest.client.test_sync import DeviceOneTimeKeysSyncTestCase
# from tests.rest.client.test_sync import DeviceUnusedFallbackKeySyncTestCase
from tests.rest.client.test_sendtodevice_base import SendToDeviceTestCaseBase
from tests.unittest import HomeserverTestCase
# Test To-Device messages working correctly with the `/sync/e2ee` endpoint (`to_device`)
class SlidingSyncE2eeSendToDeviceTestCase(SendToDeviceTestCaseBase, HomeserverTestCase):
def default_config(self) -> JsonDict:
config = super().default_config()
# Enable sliding sync
config["experimental_features"] = {"msc3575_enabled": True}
return config
def prepare(self, reactor: MemoryReactor, clock: Clock, hs: HomeServer) -> None:
# Use the Sliding Sync `/sync/e2ee` endpoint
self.sync_endpoint = "/_matrix/client/unstable/org.matrix.msc3575/sync/e2ee"
# See SendToDeviceTestCaseBase for tests