diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2019-05-21 11:36:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-21 11:36:50 -0500 |
commit | 4a30e4acb4ef14431914bd42ad09a51bd81d6c3e (patch) | |
tree | 7857cc1ab121d9255183b51be0e79d8619cc3c8f /tests/rest/client/v1 | |
parent | Merge pull request #5203 from matrix-org/erikj/aggregate_by_sender (diff) | |
download | synapse-4a30e4acb4ef14431914bd42ad09a51bd81d6c3e.tar.xz |
Room Statistics (#4338)
Diffstat (limited to 'tests/rest/client/v1')
-rw-r--r-- | tests/rest/client/v1/utils.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/rest/client/v1/utils.py b/tests/rest/client/v1/utils.py index 05b0143c42..f7133fc12e 100644 --- a/tests/rest/client/v1/utils.py +++ b/tests/rest/client/v1/utils.py @@ -127,3 +127,20 @@ class RestHelper(object): ) return channel.json_body + + def send_state(self, room_id, event_type, body, tok, expect_code=200): + path = "/_matrix/client/r0/rooms/%s/state/%s" % (room_id, event_type) + if tok: + path = path + "?access_token=%s" % tok + + request, channel = make_request( + self.hs.get_reactor(), "PUT", path, json.dumps(body).encode('utf8') + ) + render(request, self.resource, self.hs.get_reactor()) + + assert int(channel.result["code"]) == expect_code, ( + "Expected: %d, got: %d, resp: %r" + % (expect_code, int(channel.result["code"]), channel.result["body"]) + ) + + return channel.json_body |