Skip to content

Commit 255b64d

Browse files
committed
fixes tests
1 parent 8573eca commit 255b64d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,21 @@ async def batch_get_trashed_by_primary_gid(
8181
Returns:
8282
values of trashed_by_primary_gid in the SAME ORDER as projects_uuids
8383
"""
84+
if not projects_uuids:
85+
return []
86+
8487
projects_uuids_str = [f"{uuid}" for uuid in projects_uuids]
88+
8589
query = (
8690
sa.select(
8791
users.c.primary_gid.label("trashed_by_primary_gid"),
8892
)
8993
.select_from(projects.outerjoin(users, projects.c.trashed_by == users.c.id))
9094
.where(projects.c.uuid.in_(projects_uuids_str))
9195
).order_by(
92-
# Preserves the order of projects_uuids
93-
sa.case(
94-
*[
95-
(projects.c.uuid == uuid, index)
96-
for index, uuid in enumerate(projects_uuids_str)
97-
]
98-
)
96+
*[
97+
projects.c.uuid == uuid for uuid in projects_uuids_str
98+
] # Preserves the order of project_uuids
9999
)
100100
async with pass_or_acquire_connection(get_asyncpg_engine(app), connection) as conn:
101101
result = await conn.stream(query)

services/web/server/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ async def _creator(
439439
"folderId",
440440
]
441441

442-
for key in new_project:
442+
for key in expected_data:
443443
if key not in modified_fields:
444444
assert expected_data[key] == new_project[key]
445445

0 commit comments

Comments
 (0)