Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jun 6, 2022
1 parent 84eb1c8 commit d790d57
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion synapse/storage/controllers/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,6 @@ async def get_current_state_event(
async def get_current_hosts_in_room(self, room_id: str) -> Set[str]:
"""Get current hosts in room based on current state."""

await self._partial_state_room_tracker.await_full_state(room_id)
# await self._partial_state_room_tracker.await_full_state(room_id)

return await self.stores.main.get_current_hosts_in_room(room_id)
2 changes: 1 addition & 1 deletion tests/federation/test_federation_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
)

Expand Down
6 changes: 4 additions & 2 deletions tests/handlers/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit d790d57

Please sign in to comment.