diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-06-05 14:42:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 14:42:55 -0400 |
commit | 737b4a936e35daaa839e7296d888041941546b47 (patch) | |
tree | 54bf774f1dca24f5826032403a194972c24d756f /tests/handlers | |
parent | Add an option to disable autojoin for guest accounts (#6637) (diff) | |
download | synapse-737b4a936e35daaa839e7296d888041941546b47.tar.xz |
Convert user directory handler and related classes to async/await. (#7640)
Diffstat (limited to 'tests/handlers')
-rw-r--r-- | tests/handlers/test_user_directory.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/handlers/test_user_directory.py b/tests/handlers/test_user_directory.py index 572df8d80b..c15bce5bef 100644 --- a/tests/handlers/test_user_directory.py +++ b/tests/handlers/test_user_directory.py @@ -14,6 +14,8 @@ # limitations under the License. from mock import Mock +from twisted.internet import defer + import synapse.rest.admin from synapse.api.constants import UserTypes from synapse.rest.client.v1 import login, room @@ -75,18 +77,16 @@ class UserDirectoryTestCase(unittest.HomeserverTestCase): ) ) - self.store.remove_from_user_dir = Mock() - self.store.remove_from_user_in_public_room = Mock() + self.store.remove_from_user_dir = Mock(return_value=defer.succeed(None)) self.get_success(self.handler.handle_user_deactivated(s_user_id)) self.store.remove_from_user_dir.not_called() - self.store.remove_from_user_in_public_room.not_called() def test_handle_user_deactivated_regular_user(self): r_user_id = "@regular:test" self.get_success( self.store.register_user(user_id=r_user_id, password_hash=None) ) - self.store.remove_from_user_dir = Mock() + self.store.remove_from_user_dir = Mock(return_value=defer.succeed(None)) self.get_success(self.handler.handle_user_deactivated(r_user_id)) self.store.remove_from_user_dir.called_once_with(r_user_id) |