Skip to content

Commit f74ba4a

Browse files
committed
Fix mapping from database result, missing a column
1 parent 844c6ff commit f74ba4a

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

components/renku_data_services/data_connectors/db.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import TypeVar
99

1010
from cryptography.hazmat.primitives.asymmetric import rsa
11-
from sqlalchemy import ColumnExpressionArgument, Select, delete, exists, func, or_, select, and_
11+
from sqlalchemy import ColumnExpressionArgument, Select, and_, delete, exists, func, or_, select
1212
from sqlalchemy.ext.asyncio import AsyncSession
1313
from sqlalchemy.orm import joinedload
1414
from ulid import ULID
@@ -663,6 +663,7 @@ async def get_project_storage_allows(
663663
ProjectORM.name,
664664
ns_schemas.NamespaceORM.slug.label("namespace_slug"),
665665
ns_schemas.EntitySlugORM.slug.label("project_slug"),
666+
schemas.ProjectStorageAllowORM.updated_at,
666667
)
667668
.join(ProjectORM, ProjectORM.id == schemas.ProjectStorageAllowORM.project_id)
668669
.join(

test/bases/renku_data_services/data_api/test_data_connectors.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,3 +3577,25 @@ async def test_patch_storage_allow_min_size(
35773577

35783578
assert response.status_code == 422, response.text
35793579
assert "at least 1GB" in response.text
3580+
3581+
3582+
@pytest.mark.asyncio
3583+
async def test_get_all_storage_allow(
3584+
sanic_client: SanicASGITestClient, create_project, admin_headers: dict[str, str], user_headers: dict[str, str]
3585+
) -> None:
3586+
project = await create_project(sanic_client, "Test Project")
3587+
project_id = project["id"]
3588+
3589+
payload = {"project_id": project_id, "max_size": 10}
3590+
_, response = await sanic_client.post(
3591+
"/api/data/data_connectors/storage/allow", headers=admin_headers, json=payload
3592+
)
3593+
assert response.status_code == 201, response.text
3594+
3595+
_, response = await sanic_client.get("/api/data/data_connectors/storage/allow", headers=admin_headers)
3596+
assert response.status_code == 200, response.text
3597+
assert response.json is not None, f"No json response body: {response.text}"
3598+
assert isinstance(response.json, list)
3599+
assert len(response.json) == 1
3600+
assert response.json[0]["project_id"] == project_id
3601+
assert response.json[0]["max_size"] == 10

0 commit comments

Comments
 (0)