diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-07-17 07:09:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-17 07:09:25 -0400 |
commit | 6b3ac3b8cddda9911f42a08a0dcefc4a3386ff51 (patch) | |
tree | e563590dfec473a88e347b6e0a4422f89af3ef6c /tests/test_federation.py | |
parent | Convert synapse.app to async/await. (#7868) (diff) | |
download | synapse-6b3ac3b8cddda9911f42a08a0dcefc4a3386ff51.tar.xz |
Convert device handler to async/await (#7871)
Diffstat (limited to '')
-rw-r--r-- | tests/test_federation.py | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/tests/test_federation.py b/tests/test_federation.py index 89dcc58b99..87a16d7d7a 100644 --- a/tests/test_federation.py +++ b/tests/test_federation.py @@ -173,7 +173,7 @@ class MessageAcceptTests(unittest.HomeserverTestCase): # Register a mock on the store so that the incoming update doesn't fail because # we don't share a room with the user. store = self.homeserver.get_datastore() - store.get_rooms_for_user = Mock(return_value=["!someroom:test"]) + store.get_rooms_for_user = Mock(return_value=succeed(["!someroom:test"])) # Manually inject a fake device list update. We need this update to include at # least one prev_id so that the user's device list will need to be retried. @@ -218,23 +218,26 @@ class MessageAcceptTests(unittest.HomeserverTestCase): # Register mock device list retrieval on the federation client. federation_client = self.homeserver.get_federation_client() federation_client.query_user_devices = Mock( - return_value={ - "user_id": remote_user_id, - "stream_id": 1, - "devices": [], - "master_key": { + return_value=succeed( + { "user_id": remote_user_id, - "usage": ["master"], - "keys": {"ed25519:" + remote_master_key: remote_master_key}, - }, - "self_signing_key": { - "user_id": remote_user_id, - "usage": ["self_signing"], - "keys": { - "ed25519:" + remote_self_signing_key: remote_self_signing_key + "stream_id": 1, + "devices": [], + "master_key": { + "user_id": remote_user_id, + "usage": ["master"], + "keys": {"ed25519:" + remote_master_key: remote_master_key}, }, - }, - } + "self_signing_key": { + "user_id": remote_user_id, + "usage": ["self_signing"], + "keys": { + "ed25519:" + + remote_self_signing_key: remote_self_signing_key + }, + }, + } + ) ) # Resync the device list. |