mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-09 03:14:58 -04:00
Use literals in place of HTTPStatus
constants in tests (#13479)
Replace - `HTTPStatus.NOT_FOUND` - `HTTPStatus.FORBIDDEN` - `HTTPStatus.UNAUTHORIZED` - `HTTPStatus.CONFLICT` - `HTTPStatus.CREATED` Signed-off-by: Dirk Klimpel <dirk@klimpel.org>
This commit is contained in:
parent
54fb517c28
commit
1595052b26
12 changed files with 141 additions and 141 deletions
|
@ -57,7 +57,7 @@ class ServerNoticeTestCase(unittest.HomeserverTestCase):
|
|||
channel = self.make_request("POST", self.url)
|
||||
|
||||
self.assertEqual(
|
||||
HTTPStatus.UNAUTHORIZED,
|
||||
401,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -72,7 +72,7 @@ class ServerNoticeTestCase(unittest.HomeserverTestCase):
|
|||
)
|
||||
|
||||
self.assertEqual(
|
||||
HTTPStatus.FORBIDDEN,
|
||||
403,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -80,7 +80,7 @@ class ServerNoticeTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
@override_config({"server_notices": {"system_mxid_localpart": "notices"}})
|
||||
def test_user_does_not_exist(self) -> None:
|
||||
"""Tests that a lookup for a user that does not exist returns a HTTPStatus.NOT_FOUND"""
|
||||
"""Tests that a lookup for a user that does not exist returns a 404"""
|
||||
channel = self.make_request(
|
||||
"POST",
|
||||
self.url,
|
||||
|
@ -88,7 +88,7 @@ class ServerNoticeTestCase(unittest.HomeserverTestCase):
|
|||
content={"user_id": "@unknown_person:test", "content": ""},
|
||||
)
|
||||
|
||||
self.assertEqual(HTTPStatus.NOT_FOUND, channel.code, msg=channel.json_body)
|
||||
self.assertEqual(404, channel.code, msg=channel.json_body)
|
||||
self.assertEqual(Codes.NOT_FOUND, channel.json_body["errcode"])
|
||||
|
||||
@override_config({"server_notices": {"system_mxid_localpart": "notices"}})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue