From d2798de660c84dea775f3c79ff8200baf084d244 Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 26 Aug 2014 19:49:42 +0100 Subject: Fold federation/handler into handlers/federation --- tests/handlers/test_room.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'tests/handlers/test_room.py') diff --git a/tests/handlers/test_room.py b/tests/handlers/test_room.py index a1ab8dde68..613f5c307e 100644 --- a/tests/handlers/test_room.py +++ b/tests/handlers/test_room.py @@ -53,23 +53,26 @@ class RoomMemberHandlerTestCase(unittest.TestCase): handlers=NonCallableMock(spec_set=[ "room_member_handler", "profile_handler", + "federation_handler", ]), auth=NonCallableMock(spec_set=["check"]), - federation=NonCallableMock(spec_set=[ - "handle_new_event", - "get_state_for_room", - ]), state_handler=NonCallableMock(spec_set=["handle_new_event"]), ) + self.federation = NonCallableMock(spec_set=[ + "handle_new_event", + "get_state_for_room", + ]) + self.datastore = hs.get_datastore() self.handlers = hs.get_handlers() self.notifier = hs.get_notifier() - self.federation = hs.get_federation() self.state_handler = hs.get_state_handler() self.distributor = hs.get_distributor() self.hs = hs + self.handlers.federation_handler = self.federation + self.distributor.declare("collect_presencelike_data") self.handlers.room_member_handler = RoomMemberHandler(self.hs) @@ -333,21 +336,24 @@ class RoomCreationTest(unittest.TestCase): handlers=NonCallableMock(spec_set=[ "room_creation_handler", "room_member_handler", + "federation_handler", ]), auth=NonCallableMock(spec_set=["check"]), - federation=NonCallableMock(spec_set=[ - "handle_new_event", - ]), state_handler=NonCallableMock(spec_set=["handle_new_event"]), ) + self.federation = NonCallableMock(spec_set=[ + "handle_new_event", + ]) + self.datastore = hs.get_datastore() self.handlers = hs.get_handlers() self.notifier = hs.get_notifier() - self.federation = hs.get_federation() self.state_handler = hs.get_state_handler() self.hs = hs + self.handlers.federation_handler = self.federation + self.handlers.room_creation_handler = RoomCreationHandler(self.hs) self.room_creation_handler = self.handlers.room_creation_handler -- cgit 1.4.1