summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@arasphere.net>2017-12-05 11:09:47 +0000
committerGitHub <noreply@github.com>2017-12-05 11:09:47 +0000
commit33cb7ef0b7f0c8e31abf580ba3ffa33c255f0a55 (patch)
tree196666de4e0fe2263544c8db3f74dbc48798e64a /tests
parentFix error when deleting devices (diff)
parentfix StoreError syntax (diff)
downloadsynapse-33cb7ef0b7f0c8e31abf580ba3ffa33c255f0a55.tar.xz
Merge pull request #2723 from matrix-org/matthew/search-all-local-users
Add all local users to the user_directory and optionally search them
Diffstat (limited to 'tests')
-rw-r--r--tests/handlers/test_typing.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/handlers/test_typing.py b/tests/handlers/test_typing.py

index dbe50383da..fcd380b03a 100644 --- a/tests/handlers/test_typing.py +++ b/tests/handlers/test_typing.py
@@ -58,7 +58,7 @@ class TypingNotificationsTestCase(unittest.TestCase): self.mock_federation_resource = MockHttpResource() - mock_notifier = Mock(spec=["on_new_event"]) + mock_notifier = Mock() self.on_new_event = mock_notifier.on_new_event self.auth = Mock(spec=[]) @@ -76,6 +76,9 @@ class TypingNotificationsTestCase(unittest.TestCase): "set_received_txn_response", "get_destination_retry_timings", "get_devices_by_remote", + # Bits that user_directory needs + "get_user_directory_stream_pos", + "get_current_state_deltas", ]), state_handler=self.state_handler, handlers=None, @@ -122,6 +125,15 @@ class TypingNotificationsTestCase(unittest.TestCase): return set(str(u) for u in self.room_members) self.state_handler.get_current_user_in_room = get_current_user_in_room + self.datastore.get_user_directory_stream_pos.return_value = ( + # we deliberately return a non-None stream pos to avoid doing an initial_spam + defer.succeed(1) + ) + + self.datastore.get_current_state_deltas.return_value = ( + None + ) + self.auth.check_joined_room = check_joined_room self.datastore.get_to_device_stream_token = lambda: 0