Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/tests/_internal/server/routers/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def test_returns_403_if_not_authenticated(self, client: AsyncClient):
"/api/files/get_archive_by_hash",
json={"hash": "blob_hash"},
)
assert response.status_code == 403
assert response.status_code in [401, 403]

async def test_returns_400_if_archive_does_not_exist(
self, session: AsyncSession, client: AsyncClient
Expand Down Expand Up @@ -81,7 +81,7 @@ async def test_returns_403_if_not_authenticated(self, client: AsyncClient):
"/api/files/upload_archive",
files={"file": self.file},
)
assert response.status_code == 403
assert response.status_code in [401, 403]

async def test_returns_existing_archive(
self, session: AsyncSession, client: AsyncClient, default_storage_mock: Mock
Expand Down
14 changes: 7 additions & 7 deletions src/tests/_internal/server/routers/test_fleets.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/fleets/list")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -147,7 +147,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/fleets/list")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -188,7 +188,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/fleets/get")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -309,7 +309,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/fleets/apply")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -829,7 +829,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/fleets/delete")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -942,7 +942,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/fleets/delete_instances")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -1036,7 +1036,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/fleets/get_plan")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/_internal/server/routers/test_gateways.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/gateways/list")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/_internal/server/routers/test_instances.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ async def test_pagination(

async def test_not_authenticated(self, client: AsyncClient, data) -> None:
resp = await client.post("/api/instances/list", json={})
assert resp.status_code == 403
assert resp.status_code in [401, 403]


@pytest.mark.asyncio
Expand Down
2 changes: 1 addition & 1 deletion src/tests/_internal/server/routers/test_prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ async def test_returns_403_if_not_authenticated(
else:
headers = None
response = await client.get("/metrics", headers=headers)
assert response.status_code == 403
assert response.status_code in [401, 403]

async def test_returns_200_if_token_is_valid(
self, monkeypatch: pytest.MonkeyPatch, client: AsyncClient
Expand Down
10 changes: 5 additions & 5 deletions src/tests/_internal/server/routers/test_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/volumes/list")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -198,7 +198,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/volumes/list")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -249,7 +249,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/volumes/get")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -316,7 +316,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/volumes/create")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down Expand Up @@ -366,7 +366,7 @@ async def test_returns_40x_if_not_authenticated(
self, test_db, session: AsyncSession, client: AsyncClient
):
response = await client.post("/api/project/main/volumes/delete")
assert response.status_code == 403
assert response.status_code in [401, 403]

@pytest.mark.asyncio
@pytest.mark.parametrize("test_db", ["sqlite", "postgres"], indirect=True)
Expand Down