Use status 404 in more places when appropriate (#5480)

This commit is contained in:
Mike Degatano
2024-12-17 05:18:32 -05:00
committed by GitHub
parent de68868788
commit d8101ddba8
18 changed files with 374 additions and 139 deletions

View File

@@ -400,3 +400,22 @@ async def test_api_network_vlan(
"id": Variant("u", 1),
"parent": Variant("s", "0c23631e-2118-355c-bbb0-8943229cb0d6"),
}
@pytest.mark.parametrize(
("method", "url"),
[
("get", "/network/interface/bad/info"),
("post", "/network/interface/bad/update"),
("get", "/network/interface/bad/accesspoints"),
("post", "/network/interface/bad/vlan/1"),
],
)
async def test_network_interface_not_found(
api_client: TestClient, method: str, url: str
):
"""Test network interface not found error."""
resp = await api_client.request(method, url)
assert resp.status == 404
body = await resp.json()
assert body["message"] == "Interface bad does not exist"