diff options
author | Eric Eastwood <eric.eastwood@beta.gouv.fr> | 2024-07-25 13:43:53 -0500 |
---|---|---|
committer | Eric Eastwood <eric.eastwood@beta.gouv.fr> | 2024-07-25 13:43:53 -0500 |
commit | f1db02e31b628ea505ff942529c508746dc0764e (patch) | |
tree | 5a8fab28427eb67c6eb10e59c8533aa02b9b121f | |
parent | Merge branch 'develop' into madlittlemods/sliding-sync-receipts-extension (diff) | |
download | synapse-f1db02e31b628ea505ff942529c508746dc0764e.tar.xz |
Remove tests that aren't necessary
-rw-r--r-- | synapse/handlers/account_data.py | 1 | ||||
-rw-r--r-- | tests/rest/client/test_sync.py | 100 |
2 files changed, 0 insertions, 101 deletions
diff --git a/synapse/handlers/account_data.py b/synapse/handlers/account_data.py index 8041326cd5..97a463d8d0 100644 --- a/synapse/handlers/account_data.py +++ b/synapse/handlers/account_data.py @@ -327,7 +327,6 @@ class AccountDataEventSource(EventSource[int, JsonDict]): explicit_room_id: Optional[str] = None, ) -> Tuple[List[JsonDict], int]: user_id = user.to_string() - # TODO: Take `to_key` into account last_stream_id = from_key current_stream_id = self.store.get_max_account_data_stream_id() diff --git a/tests/rest/client/test_sync.py b/tests/rest/client/test_sync.py index 4422deb884..c60d0e1d25 100644 --- a/tests/rest/client/test_sync.py +++ b/tests/rest/client/test_sync.py @@ -5935,106 +5935,6 @@ class SlidingSyncReceiptsExtensionTestCase(unittest.HomeserverTestCase): exact=True, ) - def test_global_account_data_initial_sync(self) -> None: - """ - On initial sync, we should return all global account data on initial sync. - """ - user1_id = self.register_user("user1", "pass") - user1_tok = self.login(user1_id, "pass") - - # Update the global account data - self.get_success( - self.account_data_handler.add_account_data_for_user( - user_id=user1_id, - account_data_type="org.matrix.foobarbaz", - content={"foo": "bar"}, - ) - ) - - # Make an initial Sliding Sync request with the account_data extension enabled - sync_body = { - "lists": {}, - "extensions": { - "receipts": { - "enabled": True, - } - }, - } - response_body, _ = self.do_sync(sync_body, tok=user1_tok) - - # It should show us all of the global account data - self.assertIncludes( - { - global_event["type"] - for global_event in response_body["extensions"]["account_data"].get( - "global" - ) - }, - {AccountDataTypes.PUSH_RULES, "org.matrix.foobarbaz"}, - exact=True, - ) - self.assertIncludes( - response_body["extensions"]["account_data"].get("rooms").keys(), - set(), - exact=True, - ) - - def test_global_account_data_incremental_sync(self) -> None: - """ - On incremental sync, we should only account data that has changed since the - `from_token`. - """ - user1_id = self.register_user("user1", "pass") - user1_tok = self.login(user1_id, "pass") - - # Add some global account data - self.get_success( - self.account_data_handler.add_account_data_for_user( - user_id=user1_id, - account_data_type="org.matrix.foobarbaz", - content={"foo": "bar"}, - ) - ) - - sync_body = { - "lists": {}, - "extensions": { - "receipts": { - "enabled": True, - } - }, - } - _, from_token = self.do_sync(sync_body, tok=user1_tok) - - # Add some other global account data - self.get_success( - self.account_data_handler.add_account_data_for_user( - user_id=user1_id, - account_data_type="org.matrix.doodardaz", - content={"doo": "dar"}, - ) - ) - - # Make an incremental Sliding Sync request with the account_data extension enabled - response_body, _ = self.do_sync(sync_body, since=from_token, tok=user1_tok) - - self.assertIncludes( - { - global_event["type"] - for global_event in response_body["extensions"]["account_data"].get( - "global" - ) - }, - # We should only see the new global account data that happened after the `from_token` - {"org.matrix.doodardaz"}, - exact=True, - ) - self.assertIncludes( - response_body["extensions"]["account_data"].get("rooms").keys(), - set(), - exact=True, - ) - def test_room_account_data_initial_sync(self) -> None: """ On initial sync, we return all account data for a given room but only for |