diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-08-27 16:54:12 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-08-27 16:54:12 +0100 |
commit | 1d95e78759cc1307d15d6cc6388f52063e833355 (patch) | |
tree | 0307617989016019bfd1d41a15b22499d02091ef /tests/rest/utils.py | |
parent | add _get_room_member, fix datastore methods (diff) | |
parent | Added RestServlet for /rooms/$roomid/initialSync (diff) | |
download | synapse-1d95e78759cc1307d15d6cc6388f52063e833355.tar.xz |
Merge branch 'develop' into storage_transactions
Diffstat (limited to 'tests/rest/utils.py')
-rw-r--r-- | tests/rest/utils.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/rest/utils.py b/tests/rest/utils.py index 590d12f155..ef9a6071e2 100644 --- a/tests/rest/utils.py +++ b/tests/rest/utils.py @@ -24,6 +24,7 @@ from synapse.api.constants import Membership import json import time + class RestTestCase(unittest.TestCase): """Contains extra helper functions to quickly and clearly perform a given REST action, which isn't the focus of the test. @@ -40,18 +41,19 @@ class RestTestCase(unittest.TestCase): return self.auth_user_id @defer.inlineCallbacks - def create_room_as(self, room_id, room_creator, is_public=True, tok=None): + def create_room_as(self, room_creator, is_public=True, tok=None): temp_id = self.auth_user_id self.auth_user_id = room_creator - path = "/rooms/%s" % room_id + path = "/createRoom" content = "{}" if not is_public: content = '{"visibility":"private"}' if tok: path = path + "?access_token=%s" % tok - (code, response) = yield self.mock_resource.trigger("PUT", path, content) + (code, response) = yield self.mock_resource.trigger("POST", path, content) self.assertEquals(200, code, msg=str(response)) self.auth_user_id = temp_id + defer.returnValue(response["room_id"]) @defer.inlineCallbacks def invite(self, room=None, src=None, targ=None, expect_code=200, tok=None): |