summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py
index f40cbce51d..6666b06931 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -127,6 +127,15 @@ class MemoryDataStore(object):
         self.current_state = {}
         self.events = []
 
+    class Snapshot(namedtuple("Snapshot", "room_id user_id membership_state")):
+        def fill_out_prev_events(self, event):
+            pass
+
+    def snapshot_room(self, room_id, user_id, state_type=None, state_key=None):
+        return self.Snapshot(
+            room_id, user_id, self.get_room_member(user_id, room_id)
+        )
+
     def register(self, user_id, token, password_hash):
         if user_id in self.tokens_to_users.values():
             raise StoreError(400, "User in use.")