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:
Dirk Klimpel 2022-08-09 15:56:43 +02:00 committed by GitHub
parent 54fb517c28
commit 1595052b26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 141 additions and 141 deletions

View file

@ -13,7 +13,6 @@
# limitations under the License.
import urllib.parse
from http import HTTPStatus
from parameterized import parameterized
@ -79,10 +78,10 @@ class QuarantineMediaTestCase(unittest.HomeserverTestCase):
# Should be quarantined
self.assertEqual(
HTTPStatus.NOT_FOUND,
404,
channel.code,
msg=(
"Expected to receive a HTTPStatus.NOT_FOUND on accessing quarantined media: %s"
"Expected to receive a 404 on accessing quarantined media: %s"
% server_and_media_id
),
)
@ -107,7 +106,7 @@ class QuarantineMediaTestCase(unittest.HomeserverTestCase):
# Expect a forbidden error
self.assertEqual(
HTTPStatus.FORBIDDEN,
403,
channel.code,
msg="Expected forbidden on quarantining media as a non-admin",
)