summary refs log tree commit diff
path: root/tests/rest/client/utils.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-01-07 16:43:21 +0000
committerGitHub <noreply@github.com>2022-01-07 16:43:21 +0000
commit2bb4bd126946df46aacf6849f0acb01e78f7d807 (patch)
tree78feea3ac1e0e7d0977c55bf1730589d227d9072 /tests/rest/client/utils.py
parentMerge branch 'release-v1.50' into develop (diff)
downloadsynapse-2bb4bd126946df46aacf6849f0acb01e78f7d807.tar.xz
Test that bans win a join against a race when computing `/sync` response (#11701)
Diffstat (limited to 'tests/rest/client/utils.py')
-rw-r--r--tests/rest/client/utils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/rest/client/utils.py b/tests/rest/client/utils.py
index 1af5e5cee5..8424383580 100644
--- a/tests/rest/client/utils.py
+++ b/tests/rest/client/utils.py
@@ -196,6 +196,16 @@ class RestHelper:
             expect_code=expect_code,
         )
 
+    def ban(self, room: str, src: str, targ: str, **kwargs: object):
+        """A convenience helper: `change_membership` with `membership` preset to "ban"."""
+        self.change_membership(
+            room=room,
+            src=src,
+            targ=targ,
+            membership=Membership.BAN,
+            **kwargs,
+        )
+
     def change_membership(
         self,
         room: str,