|
15 | 15 | import socketio |
16 | 16 | import socketio.exceptions |
17 | 17 | from aiohttp.test_utils import TestClient |
18 | | -from aioresponses import aioresponses |
19 | 18 | from pytest_mock import MockerFixture |
20 | 19 | from pytest_simcore.helpers.assert_checks import assert_status |
21 | 20 | from pytest_simcore.helpers.webserver_projects import NewProject |
22 | 21 | from servicelib.aiohttp import status |
23 | | -from servicelib.common_headers import UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE |
24 | 22 | from simcore_postgres_database.models.users import UserRole |
25 | | -from simcore_service_webserver.projects._projects_service import ( |
26 | | - remove_project_dynamic_services, |
27 | | - submit_delete_project_task, |
28 | | -) |
29 | 23 | from simcore_service_webserver.resource_manager.registry import ( |
30 | 24 | RedisResourceRegistry, |
31 | 25 | UserSessionDict, |
32 | 26 | get_registry, |
33 | 27 | ) |
34 | | -from simcore_service_webserver.users.exceptions import UserNotFoundError |
35 | | -from simcore_service_webserver.users.users_service import delete_user_without_projects |
36 | 28 | from tenacity.asyncio import AsyncRetrying |
37 | 29 | from tenacity.retry import retry_if_exception_type |
38 | 30 | from tenacity.stop import stop_after_delay |
@@ -339,45 +331,3 @@ async def mocked_notification_system(mocker): |
339 | 331 | mocked_notification_system.return_value.set_result("") |
340 | 332 | mocks["mocked_notification_system"] = mocked_notification_system |
341 | 333 | return mocks |
342 | | - |
343 | | - |
344 | | -@pytest.mark.parametrize("user_role", [UserRole.USER, UserRole.TESTER, UserRole.GUEST]) |
345 | | -async def test_regression_removing_unexisting_user( |
346 | | - director_v2_service_mock: aioresponses, |
347 | | - client: TestClient, |
348 | | - logged_user: dict[str, Any], |
349 | | - empty_user_project: dict[str, Any], |
350 | | - user_role: UserRole, |
351 | | - mock_storage_delete_data_folders: mock.Mock, |
352 | | -) -> None: |
353 | | - # regression test for https://github.com/ITISFoundation/osparc-simcore/issues/2504 |
354 | | - assert client.app |
355 | | - # remove project |
356 | | - user_id = logged_user["id"] |
357 | | - delete_task = await submit_delete_project_task( |
358 | | - app=client.app, |
359 | | - project_uuid=empty_user_project["uuid"], |
360 | | - user_id=user_id, |
361 | | - simcore_user_agent=UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE, |
362 | | - ) |
363 | | - await delete_task |
364 | | - # remove user |
365 | | - await delete_user_without_projects(app=client.app, user_id=user_id) |
366 | | - |
367 | | - with pytest.raises(UserNotFoundError): |
368 | | - await remove_project_dynamic_services( |
369 | | - user_id=user_id, |
370 | | - project_uuid=empty_user_project["uuid"], |
371 | | - app=client.app, |
372 | | - simcore_user_agent=UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE, |
373 | | - ) |
374 | | - await remove_project_dynamic_services( |
375 | | - user_id=user_id, |
376 | | - project_uuid=empty_user_project["uuid"], |
377 | | - app=client.app, |
378 | | - simcore_user_agent=UNDEFINED_DEFAULT_SIMCORE_USER_AGENT_VALUE, |
379 | | - ) |
380 | | - # since the call to delete is happening as fire and forget task, let's wait until it is done |
381 | | - async for attempt in AsyncRetrying(**_TENACITY_ASSERT_RETRY): |
382 | | - with attempt: |
383 | | - mock_storage_delete_data_folders.assert_called() |
0 commit comments