From 0438d1764ae1820587cb92a3a947ac2f57ad2283 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 6 Jun 2022 13:58:44 +0100 Subject: [PATCH] Fix tests --- tests/federation/test_federation_sender.py | 2 +- tests/handlers/test_typing.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/federation/test_federation_sender.py b/tests/federation/test_federation_sender.py index 8208736ab4b4..a75ba249136d 100644 --- a/tests/federation/test_federation_sender.py +++ b/tests/federation/test_federation_sender.py @@ -34,7 +34,7 @@ def make_homeserver(self, reactor, clock): federation_transport_client=Mock(spec=["send_transaction"]), ) - hs.get_datastores().main.get_current_hosts_in_room = Mock( + hs.get_storage_controllers().state.get_current_hosts_in_room = Mock( return_value=make_awaitable(["test", "host2"]) ) diff --git a/tests/handlers/test_typing.py b/tests/handlers/test_typing.py index 14a0ee4922ed..7af1333126ac 100644 --- a/tests/handlers/test_typing.py +++ b/tests/handlers/test_typing.py @@ -129,10 +129,12 @@ async def check_host_in_room(room_id: str, server_name: str) -> bool: hs.get_event_auth_handler().check_host_in_room = check_host_in_room - def get_joined_hosts_for_room(room_id: str): + async def get_current_hosts_in_room(room_id: str): return {member.domain for member in self.room_members} - self.datastore.get_joined_hosts_for_room = get_joined_hosts_for_room + hs.get_storage_controllers().state.get_current_hosts_in_room = ( + get_current_hosts_in_room + ) async def get_users_in_room(room_id: str): return {str(u) for u in self.room_members}