diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-09-07 02:58:18 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-07 02:58:18 +1000 |
commit | 52ec6e9dfad5e088f000d20cbb4a1bbc8008c00d (patch) | |
tree | c146b5df538580374b1412454af34eb99faae4ec /tests/test_mau.py | |
parent | Merge pull request #3800 from matrix-org/neilj/remove-guests-from-mau-count (diff) | |
download | synapse-52ec6e9dfad5e088f000d20cbb4a1bbc8008c00d.tar.xz |
Port tests/ to Python 3 (#3808)
Diffstat (limited to 'tests/test_mau.py')
-rw-r--r-- | tests/test_mau.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/test_mau.py b/tests/test_mau.py index 0732615447..bdbacb8448 100644 --- a/tests/test_mau.py +++ b/tests/test_mau.py @@ -185,20 +185,20 @@ class TestMauLimit(unittest.TestCase): self.assertEqual(e.errcode, Codes.RESOURCE_LIMIT_EXCEEDED) def create_user(self, localpart): - request_data = json.dumps({ - "username": localpart, - "password": "monkey", - "auth": {"type": LoginType.DUMMY}, - }) + request_data = json.dumps( + { + "username": localpart, + "password": "monkey", + "auth": {"type": LoginType.DUMMY}, + } + ) - request, channel = make_request(b"POST", b"/register", request_data) + request, channel = make_request("POST", "/register", request_data) render(request, self.resource, self.reactor) - if channel.result["code"] != b"200": + if channel.code != 200: raise HttpResponseException( - int(channel.result["code"]), - channel.result["reason"], - channel.result["body"], + channel.code, channel.result["reason"], channel.result["body"] ).to_synapse_error() access_token = channel.json_body["access_token"] @@ -206,12 +206,12 @@ class TestMauLimit(unittest.TestCase): return access_token def do_sync_for_user(self, token): - request, channel = make_request(b"GET", b"/sync", access_token=token) + request, channel = make_request( + "GET", "/sync", access_token=token.encode('ascii') + ) render(request, self.resource, self.reactor) - if channel.result["code"] != b"200": + if channel.code != 200: raise HttpResponseException( - int(channel.result["code"]), - channel.result["reason"], - channel.result["body"], + channel.code, channel.result["reason"], channel.result["body"] ).to_synapse_error() |