mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-23 21:20:36 -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
|
@ -75,7 +75,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
"""Try to create a token without authentication."""
|
||||
channel = self.make_request("POST", self.url + "/new", {})
|
||||
self.assertEqual(
|
||||
HTTPStatus.UNAUTHORIZED,
|
||||
401,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -90,7 +90,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
access_token=self.other_user_tok,
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.FORBIDDEN,
|
||||
403,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -390,7 +390,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
{},
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.UNAUTHORIZED,
|
||||
401,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -405,7 +405,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
access_token=self.other_user_tok,
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.FORBIDDEN,
|
||||
403,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -421,7 +421,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
)
|
||||
|
||||
self.assertEqual(
|
||||
HTTPStatus.NOT_FOUND,
|
||||
404,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -606,7 +606,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
{},
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.UNAUTHORIZED,
|
||||
401,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -621,7 +621,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
access_token=self.other_user_tok,
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.FORBIDDEN,
|
||||
403,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -637,7 +637,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
)
|
||||
|
||||
self.assertEqual(
|
||||
HTTPStatus.NOT_FOUND,
|
||||
404,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -667,7 +667,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
{},
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.UNAUTHORIZED,
|
||||
401,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -682,7 +682,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
access_token=self.other_user_tok,
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.FORBIDDEN,
|
||||
403,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -698,7 +698,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
)
|
||||
|
||||
self.assertEqual(
|
||||
HTTPStatus.NOT_FOUND,
|
||||
404,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -729,7 +729,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
"""Try to list tokens without authentication."""
|
||||
channel = self.make_request("GET", self.url, {})
|
||||
self.assertEqual(
|
||||
HTTPStatus.UNAUTHORIZED,
|
||||
401,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
@ -744,7 +744,7 @@ class ManageRegistrationTokensTestCase(unittest.HomeserverTestCase):
|
|||
access_token=self.other_user_tok,
|
||||
)
|
||||
self.assertEqual(
|
||||
HTTPStatus.FORBIDDEN,
|
||||
403,
|
||||
channel.code,
|
||||
msg=channel.json_body,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue