diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2022-05-23 13:23:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-23 11:23:26 +0000 |
commit | 444588c5fc5e4fd0f3796d389fe5f062acc55286 (patch) | |
tree | 9fc7c743e6f3b19361f61035a0e6c381e782e947 /tests/http/test_servlet.py | |
parent | Fix Complement `TestCanRegisterAdmin` with workers, by adding Complement's sh... (diff) | |
download | synapse-444588c5fc5e4fd0f3796d389fe5f062acc55286.tar.xz |
Add some type hints to tests files (#12833)
Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com>
Diffstat (limited to 'tests/http/test_servlet.py')
-rw-r--r-- | tests/http/test_servlet.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/http/test_servlet.py b/tests/http/test_servlet.py index ad521525cf..b3655d7b44 100644 --- a/tests/http/test_servlet.py +++ b/tests/http/test_servlet.py @@ -49,19 +49,21 @@ class TestServletUtils(unittest.TestCase): """Basic tests for parse_json_value_from_request.""" # Test round-tripping. obj = {"foo": 1} - result = parse_json_value_from_request(make_request(obj)) - self.assertEqual(result, obj) + result1 = parse_json_value_from_request(make_request(obj)) + self.assertEqual(result1, obj) # Results don't have to be objects. - result = parse_json_value_from_request(make_request(b'["foo"]')) - self.assertEqual(result, ["foo"]) + result2 = parse_json_value_from_request(make_request(b'["foo"]')) + self.assertEqual(result2, ["foo"]) # Test empty. with self.assertRaises(SynapseError): parse_json_value_from_request(make_request(b"")) - result = parse_json_value_from_request(make_request(b""), allow_empty_body=True) - self.assertIsNone(result) + result3 = parse_json_value_from_request( + make_request(b""), allow_empty_body=True + ) + self.assertIsNone(result3) # Invalid UTF-8. with self.assertRaises(SynapseError): |