summary refs log tree commit diff
path: root/tests/rest/client/v1/utils.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-11-04 13:29:35 +0000
committerErik Johnston <erik@matrix.org>2019-11-04 13:29:35 +0000
commit6a0092d3715a168415619fd253c7fb4da5faf348 (patch)
tree72f8553014ff152fecd10a40cd2ad7b46387f44d /tests/rest/client/v1/utils.py
parentFix up comment (diff)
parentdocument the REPLICATE command a bit better (#6305) (diff)
downloadsynapse-6a0092d3715a168415619fd253c7fb4da5faf348.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_purge_history
Diffstat (limited to 'tests/rest/client/v1/utils.py')
-rw-r--r--tests/rest/client/v1/utils.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/rest/client/v1/utils.py b/tests/rest/client/v1/utils.py
index cdded88b7f..8ea0cb05ea 100644
--- a/tests/rest/client/v1/utils.py
+++ b/tests/rest/client/v1/utils.py
@@ -106,13 +106,22 @@ class RestHelper(object):
         self.auth_user_id = temp_id
 
     def send(self, room_id, body=None, txn_id=None, tok=None, expect_code=200):
-        if txn_id is None:
-            txn_id = "m%s" % (str(time.time()))
         if body is None:
             body = "body_text_here"
 
-        path = "/_matrix/client/r0/rooms/%s/send/m.room.message/%s" % (room_id, txn_id)
         content = {"msgtype": "m.text", "body": body}
+
+        return self.send_event(
+            room_id, "m.room.message", content, txn_id, tok, expect_code
+        )
+
+    def send_event(
+        self, room_id, type, content={}, txn_id=None, tok=None, expect_code=200
+    ):
+        if txn_id is None:
+            txn_id = "m%s" % (str(time.time()))
+
+        path = "/_matrix/client/r0/rooms/%s/send/%s/%s" % (room_id, type, txn_id)
         if tok:
             path = path + "?access_token=%s" % tok