synapse/tests/rest/client/test_sliding_sync.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
854 B
Python
Raw Normal View History

2024-05-08 15:48:59 +00:00
from twisted.test.proto_helpers import MemoryReactor
2024-05-08 15:48:59 +00:00
from synapse.server import HomeServer
from synapse.types import JsonDict
from synapse.util import Clock
2024-05-08 15:48:59 +00:00
from tests.rest.client.test_sendtodevice import SendToDeviceTestCase
2024-05-08 15:54:54 +00:00
# Test To-Device messages working correctly with the `/sync/e2ee` endpoint (`to_device`)
class SlidingSyncE2eeSendToDeviceTestCase(SendToDeviceTestCase):
def default_config(self) -> JsonDict:
config = super().default_config()
2024-05-08 15:48:59 +00:00
# Enable sliding sync
config["experimental_features"] = {"msc3575_enabled": True}
return config
2024-05-08 15:48:59 +00:00
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"
2024-05-08 15:54:54 +00:00
# See SendToDeviceTestCase for tests