diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-08-22 17:00:10 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-08-22 17:00:10 +0100 |
commit | 1379dcae6fb30c772fd77d68b27833fb7f418104 (patch) | |
tree | 145a0503a56336da9f25e2817f4dd87e2c8e01a7 /tests/utils.py | |
parent | Merge branch 'master' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-1379dcae6fb30c772fd77d68b27833fb7f418104.tar.xz |
Take a snapshot of the state of the room before performing updates
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py index c68b17f7b9..f10bb8960f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -127,6 +127,13 @@ class MemoryDataStore(object): self.current_state = {} self.events = [] + Snapshot = namedtuple("Snapshot", "room_id user_id membership_state") + + 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.") |