Changed errors to new type, was causing warnings

This commit is contained in:
UmmmAGoodName committed 2026-03-11 18:48:36 +01:00
1 parent 69eafda777
commit 4a45a68703
5 files changed
+13 -13

No files matched your search

@@ -297,7 +297,7 @@ class TestEthernetSwitchNodesRoutes:
node_id=ethernet_switch["node_id"]),
json=port_params
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT
async def test_ethernet_switch_delete(
@@ -133,7 +133,7 @@ class TestTemplateRoutes:
"template_type": "invalid_template_type"}
response = await client.post(app.url_path_for("create_template"), json=params)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT
async def test_template_update(self, app: FastAPI, client: AsyncClient) -> None:
+9 -9
View File
@@ -75,10 +75,10 @@ class TestUserRoutes:
(
("email", "user2@email.com", status.HTTP_400_BAD_REQUEST),
("username", "user2", status.HTTP_400_BAD_REQUEST),
("email", "invalid_email@one@two.io", status.HTTP_422_UNPROCESSABLE_ENTITY),
("password", "short", status.HTTP_422_UNPROCESSABLE_ENTITY),
("username", "user2@#$%^<>", status.HTTP_422_UNPROCESSABLE_ENTITY),
("username", "ab", status.HTTP_422_UNPROCESSABLE_ENTITY),
("email", "invalid_email@one@two.io", status.HTTP_422_UNPROCESSABLE_CONTENT),
("password", "short", status.HTTP_422_UNPROCESSABLE_CONTENT),
("username", "user2@#$%^<>", status.HTTP_422_UNPROCESSABLE_CONTENT),
("username", "ab", status.HTTP_422_UNPROCESSABLE_CONTENT),
)
)
async def test_user_registration_fails_when_credentials_are_taken(
@@ -101,10 +101,10 @@ class TestUserRoutes:
("email", "user@email.com", status.HTTP_200_OK),
("email", "user@email.com", status.HTTP_400_BAD_REQUEST),
("username", "user2", status.HTTP_400_BAD_REQUEST),
("email", "invalid_email@one@two.io", status.HTTP_422_UNPROCESSABLE_ENTITY),
("password", "short", status.HTTP_422_UNPROCESSABLE_ENTITY),
("username", "user2@#$%^<>", status.HTTP_422_UNPROCESSABLE_ENTITY),
("username", "ab", status.HTTP_422_UNPROCESSABLE_ENTITY),
("email", "invalid_email@one@two.io", status.HTTP_422_UNPROCESSABLE_CONTENT),
("password", "short", status.HTTP_422_UNPROCESSABLE_CONTENT),
("username", "user2@#$%^<>", status.HTTP_422_UNPROCESSABLE_CONTENT),
("username", "ab", status.HTTP_422_UNPROCESSABLE_CONTENT),
("full_name", "John Doe", status.HTTP_200_OK),
("password", "password123", status.HTTP_200_OK),
("is_active", True, status.HTTP_200_OK),
@@ -259,7 +259,7 @@ class TestUserLogin:
(
("wrong_username", "user1_password", status.HTTP_401_UNAUTHORIZED),
("user1", "wrong_password", status.HTTP_401_UNAUTHORIZED),
("user1", None, status.HTTP_422_UNPROCESSABLE_ENTITY),
("user1", None, status.HTTP_422_UNPROCESSABLE_CONTENT),
),
)
async def test_user_with_wrong_creds_doesnt_receive_token(
+1 -1
View File
@@ -62,4 +62,4 @@ class TestVersionRoutes:
params = "BOUM"
response = await client.post(app.url_path_for("check_version"), json=params)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT