diff options
author | Erik Johnston <erik@matrix.org> | 2020-07-31 15:07:01 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2020-07-31 15:07:01 +0100 |
commit | faba873d4b91cf03c5c2d9546a6df781ce58f2cc (patch) | |
tree | 9fca4c5ed30c77c43023d9b365a37ec90261f2b4 /tests/utils.py | |
parent | Newsfile (diff) | |
parent | Add docs for undoing room shutdowns (#7998) (diff) | |
download | synapse-faba873d4b91cf03c5c2d9546a6df781ce58f2cc.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/add_rate_limiting_to_joins
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/tests/utils.py b/tests/utils.py index a8e85436f9..a61cbdef44 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -642,14 +642,8 @@ class DeferredMockCallable(object): ) -@defer.inlineCallbacks -def create_room(hs, room_id, creator_id): +async def create_room(hs, room_id: str, creator_id: str): """Creates and persist a creation event for the given room - - Args: - hs - room_id (str) - creator_id (str) """ persistence_store = hs.get_storage().persistence @@ -657,7 +651,7 @@ def create_room(hs, room_id, creator_id): event_builder_factory = hs.get_event_builder_factory() event_creation_handler = hs.get_event_creation_handler() - yield store.store_room( + await store.store_room( room_id=room_id, room_creator_user_id=creator_id, is_public=False, @@ -675,8 +669,6 @@ def create_room(hs, room_id, creator_id): }, ) - event, context = yield defer.ensureDeferred( - event_creation_handler.create_new_client_event(builder) - ) + event, context = await event_creation_handler.create_new_client_event(builder) - yield persistence_store.persist_event(event, context) + await persistence_store.persist_event(event, context) |