diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-27 18:29:45 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2014-08-27 18:30:09 +0100 |
commit | d027e859cd284a7ce56248e36c0fb2457b8010b2 (patch) | |
tree | 27ac6024337d1824b99a4b3fd34f41f016bd6607 /tests/handlers/test_presence.py | |
parent | Define a NullSource useful for unit-testing (diff) | |
download | synapse-d027e859cd284a7ce56248e36c0fb2457b8010b2.tar.xz |
Fix up the various presence-related tests so that if they're not skipped, they still PASS
Diffstat (limited to 'tests/handlers/test_presence.py')
-rw-r--r-- | tests/handlers/test_presence.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/handlers/test_presence.py b/tests/handlers/test_presence.py index 6d3cd76dba..824ed07169 100644 --- a/tests/handlers/test_presence.py +++ b/tests/handlers/test_presence.py @@ -92,10 +92,7 @@ class PresenceStateTestCase(unittest.TestCase): self.datastore.is_presence_visible = is_presence_visible # Mock the RoomMemberHandler - room_member_handler = Mock(spec=[ - "get_rooms_for_user", - "get_room_members", - ]) + room_member_handler = Mock(spec=[]) hs.handlers.room_member_handler = room_member_handler logging.getLogger().debug("Mocking room_member_handler=%r", room_member_handler) @@ -122,6 +119,11 @@ class PresenceStateTestCase(unittest.TestCase): return defer.succeed([]) room_member_handler.get_room_members = get_room_members + def do_users_share_a_room(userlist): + shared = all(map(lambda u: u in self.room_members, userlist)) + return defer.succeed(shared) + self.datastore.do_users_share_a_room = do_users_share_a_room + self.mock_start = Mock() self.mock_stop = Mock() |