diff options
author | Erik Johnston <erik@matrix.org> | 2014-08-15 17:42:21 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-08-15 17:42:21 +0100 |
commit | f5fca6f78789e1f9711924fd4dad29c8c12b692f (patch) | |
tree | c1afe59e8702670a2a58088383ca828a24e14d60 /tests/handlers/test_room.py | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into sql_refactor (diff) | |
download | synapse-f5fca6f78789e1f9711924fd4dad29c8c12b692f.tar.xz |
Fix some of the tests to reflect changes in the storage layer.
Diffstat (limited to 'tests/handlers/test_room.py')
-rw-r--r-- | tests/handlers/test_room.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/tests/handlers/test_room.py b/tests/handlers/test_room.py index fd2d66db38..bfdde6135b 100644 --- a/tests/handlers/test_room.py +++ b/tests/handlers/test_room.py @@ -40,7 +40,7 @@ class RoomMemberHandlerTestCase(unittest.TestCase): self.hostname, db_pool=None, datastore=NonCallableMock(spec_set=[ - "store_room_member", + "persist_event", "get_joined_hosts_for_room", "get_room_member", "get_room", @@ -97,7 +97,7 @@ class RoomMemberHandlerTestCase(unittest.TestCase): ) store_id = "store_id_fooo" - self.datastore.store_room_member.return_value = defer.succeed(store_id) + self.datastore.persist_event.return_value = defer.succeed(store_id) # Actual invocation yield self.room_member_handler.change_membership(event) @@ -110,12 +110,8 @@ class RoomMemberHandlerTestCase(unittest.TestCase): set(event.destinations) ) - self.datastore.store_room_member.assert_called_once_with( - user_id=target_user_id, - sender=user_id, - room_id=room_id, - content=content, - membership=Membership.INVITE, + self.datastore.persist_event.assert_called_once_with( + event ) self.notifier.on_new_room_event.assert_called_once_with( event, store_id) @@ -149,7 +145,7 @@ class RoomMemberHandlerTestCase(unittest.TestCase): ) store_id = "store_id_fooo" - self.datastore.store_room_member.return_value = defer.succeed(store_id) + self.datastore.persist_event.return_value = defer.succeed(store_id) self.datastore.get_room.return_value = defer.succeed(1) # Not None. prev_state = NonCallableMock() @@ -171,12 +167,8 @@ class RoomMemberHandlerTestCase(unittest.TestCase): set(event.destinations) ) - self.datastore.store_room_member.assert_called_once_with( - user_id=target_user_id, - sender=user_id, - room_id=room_id, - content=content, - membership=Membership.JOIN, + self.datastore.persist_event.assert_called_once_with( + event ) self.notifier.on_new_room_event.assert_called_once_with( event, store_id) |