Skip to content

Commit

Permalink
fix usage
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Jan 17, 2025
1 parent bc5c1a1 commit eea4548
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions packages/service-library/tests/redis/test_project_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ async def test_with_project_locked(
project_uuid=project_uuid,
status=project_status,
owner=owner,
notification_cb=None,
)
async def _locked_fct() -> None:
assert await is_project_locked(redis_client_sdk, project_uuid) is True
Expand Down Expand Up @@ -118,6 +119,7 @@ async def test_lock_already_locked_project_raises(
project_uuid=project_uuid,
status=project_status,
owner=owner,
notification_cb=None,
)
async def _locked_fct() -> None:
started_event.set()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ async def _lock_project_and_remove_data(app: FastAPI, project_id: ProjectID) ->
get_redis_lock_client(app),
project_uuid=project_id,
status=ProjectStatus.MAINTAINING,
owner=None,
notification_cb=None,
)
async def _remove():
await efs_manager.remove_project_efs_data(project_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from unittest.mock import MagicMock, call

import pytest
import redis.asyncio as aioredis
import sqlalchemy as sa
from aiohttp.test_utils import TestClient
from faker import Faker
Expand All @@ -38,6 +37,7 @@
from simcore_service_webserver.db.models import UserRole
from simcore_service_webserver.projects import _crud_api_delete
from simcore_service_webserver.projects.models import ProjectDict
from simcore_service_webserver.redis import get_redis_lock_manager_client_sdk
from socketio.exceptions import ConnectionError as SocketConnectionError


Expand Down Expand Up @@ -148,7 +148,6 @@ async def test_delete_multiple_opened_project_forbidden(
user_role: UserRole,
expected_ok: HTTPStatus,
expected_forbidden: HTTPStatus,
redis_client: aioredis.Redis,
):
assert client.app

Expand Down Expand Up @@ -231,7 +230,7 @@ async def test_delete_project_while_it_is_locked_raises_error(
project_uuid = user_project["uuid"]
user_id = logged_user["id"]
await with_project_locked(
app=client.app,
get_redis_lock_manager_client_sdk(client.app),
project_uuid=project_uuid,
status=ProjectStatus.CLOSING,
owner=Owner(user_id=user_id, first_name=faker.name(), last_name=faker.name()),
Expand Down

0 comments on commit eea4548

Please sign in to comment.