diff options
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/utils.py b/tests/utils.py index 37b759febc..aa7e499e15 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -188,8 +188,9 @@ class MemoryDataStore(object): def get_rooms_for_user_where_membership_is(self, user_id, membership_list): return [ - r for r in self.members - if self.members[r].get(user_id).membership in membership_list + self.members[r].get(user_id) for r in self.members + if user_id in self.members[r] and + self.members[r][user_id].membership in membership_list ] def get_room_events_stream(self, user_id=None, from_key=None, to_key=None, @@ -233,6 +234,23 @@ class MemoryDataStore(object): def get_room_events_max_id(self): return 0 # TODO (erikj) + def get_send_event_level(self, room_id): + return defer.succeed(0) + + def get_power_level(self, room_id, user_id): + return defer.succeed(0) + + def get_add_state_level(self, room_id): + return defer.succeed(0) + + def get_room_join_rule(self, room_id): + # TODO (erikj): This should be configurable + return defer.succeed("invite") + + def get_ops_levels(self, room_id): + return defer.succeed((5, 5)) + + def _format_call(args, kwargs): return ", ".join( ["%r" % (a) for a in args] + |