Skip to content

Commit 116cb4e

Browse files
committed
fix tsets
1 parent da28668 commit 116cb4e

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

services/web/server/src/simcore_service_webserver/projects/_projects_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async def get_project(
100100
project_uuid: ProjectID,
101101
) -> ProjectDBGet:
102102
async with pass_or_acquire_connection(get_asyncpg_engine(app), connection) as conn:
103-
query = sql.select(PROJECT_DB_COLS).where(projects.c.uuid == f"{project_uuid}")
103+
query = sql.select(*PROJECT_DB_COLS).where(projects.c.uuid == f"{project_uuid}")
104104
result = await conn.execute(query)
105105
row = result.one_or_none()
106106
if row is None:

services/web/server/tests/unit/with_dbs/02/test_projects_repository.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ async def test_get_project(
2929
assert client.app
3030

3131
# Get valid project
32-
got = await projects_service_repository.get_project(
32+
got_project = await projects_service_repository.get_project(
3333
client.app, project_uuid=user_project["uuid"]
3434
)
3535

36-
assert got.uuid == UUID(user_project["uuid"])
37-
assert got.name == user_project["name"]
38-
assert got.description == user_project["description"]
36+
assert got_project.uuid == UUID(user_project["uuid"])
37+
assert got_project.name == user_project["name"]
38+
assert got_project.description == user_project["description"]
3939

4040
# Get non-existent project
4141
non_existent_project_uuid = UUID("00000000-0000-0000-0000-000000000000")
@@ -52,6 +52,9 @@ async def test_patch_project(
5252
):
5353
assert client.app
5454

55+
# Thie will change after in patched_project
56+
assert user_project["creationDate"] == user_project["lastChangeDate"]
57+
5558
# Patch valid project
5659
patch_data = {"name": "Updated Project Name"}
5760
patched_project = await projects_service_repository.patch_project(
@@ -62,6 +65,7 @@ async def test_patch_project(
6265

6366
assert patched_project.uuid == UUID(user_project["uuid"])
6467
assert patched_project.name == patch_data["name"]
68+
assert patched_project.creation_date < patched_project.last_change_date
6569

6670
# Patch non-existent project
6771
non_existent_project_uuid = UUID("00000000-0000-0000-0000-000000000000")
@@ -87,6 +91,12 @@ async def test_delete_project(
8791

8892
assert deleted_project.uuid == UUID(user_project["uuid"])
8993

94+
# Check deleted
95+
with pytest.raises(ProjectNotFoundError):
96+
await projects_service_repository.delete_project(
97+
client.app, project_uuid=user_project["uuid"]
98+
)
99+
90100
# Delete non-existent project
91101
non_existent_project_uuid = UUID("00000000-0000-0000-0000-000000000000")
92102
with pytest.raises(ProjectNotFoundError):

0 commit comments

Comments
 (0)