refactor: update authentication handling to use aiohttp.encode_basic_auth and adjust request options + fix other pytest warnings

This commit is contained in:
grossmj committed 2026-10-31 22:00:21 +07:00
1 parent 1608a65a01
commit ac65698eea
9 files changed
+50 -33

No files matched your search

@@ -130,4 +130,4 @@ class TestApplianceRoutes:
app.url_path_for("add_appliance_version", appliance_id=appliance_id),
json={"name": "bad", "registry_version": 7, "images": {"hda_disk_image": "empty99G.qcow2"}},
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT
+1 -1
View File
@@ -256,7 +256,7 @@ class TestLinkRoutes:
response = await client.post(
app.url_path_for("create_link", project_id=project.id), json={"nodes": [bad, valid]}
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT
async def test_get_link(
self, app: FastAPI, client: AsyncClient, project: Project, nodes: Tuple[Node, Node]
+2 -2
View File
@@ -142,7 +142,7 @@ class TestMarkerRoutes:
app.url_path_for("create_marker", project_id=project.id, link_id=link.id),
json={"name": "bad name!", "bpf": "icmp"},
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT
async def test_create_marker_name_too_long_rejected(
self, app: FastAPI, client: AsyncClient, project: Project
@@ -155,7 +155,7 @@ class TestMarkerRoutes:
app.url_path_for("create_marker", project_id=project.id, link_id=link.id),
json={"name": "x" * 33, "bpf": "icmp"}, # max_length is 32
)
assert response.status_code == status.HTTP_422_UNPROCESSABLE_ENTITY
assert response.status_code == status.HTTP_422_UNPROCESSABLE_CONTENT
async def test_get_markers(self, app: FastAPI, client: AsyncClient, project: Project) -> None: