diff options
author | Amber Brown <hawkowl@atleastfornow.net> | 2018-08-09 12:22:01 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-09 12:22:01 +1000 |
commit | 2511f3f8a082585e680dad200069dec77b066a6a (patch) | |
tree | 90212ffc4a723c50a537a3b1865d6468bebf431b /tests/test_server.py | |
parent | Merge pull request #3664 from matrix-org/rav/federation_metrics (diff) | |
download | synapse-2511f3f8a082585e680dad200069dec77b066a6a.tar.xz |
Test fixes for Python 3 (#3647)
Diffstat (limited to 'tests/test_server.py')
-rw-r--r-- | tests/test_server.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/tests/test_server.py b/tests/test_server.py index 7e063c0290..fc396226ea 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -1,4 +1,3 @@ -import json import re from twisted.internet.defer import Deferred @@ -104,9 +103,8 @@ class JsonResourceTests(unittest.TestCase): request.render(res) self.assertEqual(channel.result["code"], b'403') - reply_body = json.loads(channel.result["body"]) - self.assertEqual(reply_body["error"], "Forbidden!!one!") - self.assertEqual(reply_body["errcode"], "M_FORBIDDEN") + self.assertEqual(channel.json_body["error"], "Forbidden!!one!") + self.assertEqual(channel.json_body["errcode"], "M_FORBIDDEN") def test_no_handler(self): """ @@ -126,6 +124,5 @@ class JsonResourceTests(unittest.TestCase): request.render(res) self.assertEqual(channel.result["code"], b'400') - reply_body = json.loads(channel.result["body"]) - self.assertEqual(reply_body["error"], "Unrecognized request") - self.assertEqual(reply_body["errcode"], "M_UNRECOGNIZED") + self.assertEqual(channel.json_body["error"], "Unrecognized request") + self.assertEqual(channel.json_body["errcode"], "M_UNRECOGNIZED") |