|
20 | 20 | from simcore_service_webserver.db.models import UserRole |
21 | 21 | from simcore_service_webserver.projects.models import ProjectDict |
22 | 22 |
|
23 | | -# @pytest.mark.parametrize("user_role,expected", [(UserRole.USER, status.HTTP_200_OK)]) |
24 | | -# async def test_workspaces_full_workflow_deletion( |
25 | | -# client: TestClient, |
26 | | -# logged_user: UserInfoDict, |
27 | | -# user_project: ProjectDict, |
28 | | -# expected: HTTPStatus, |
29 | | -# mock_catalog_api_get_services_for_user_in_product: MockerFixture, |
30 | | -# fake_project: ProjectDict, |
31 | | -# workspaces_clean_db: None, |
32 | | -# ): |
33 | | -# assert client.app |
34 | | - |
35 | | -# # Create a new workspace |
36 | | -# url = client.app.router["create_workspace"].url_for() |
37 | | -# resp = await client.post( |
38 | | -# f"{url}", |
39 | | -# json={ |
40 | | -# "name": "My first workspace", |
41 | | -# "description": "Custom description", |
42 | | -# "thumbnail": None, |
43 | | -# }, |
44 | | -# ) |
45 | | -# data, _ = await assert_status(resp, status.HTTP_201_CREATED) |
46 | | -# added_workspace = WorkspaceGet.model_validate(data) |
47 | | - |
48 | | -# # Create project **in workspace** |
49 | | -# project_data = deepcopy(fake_project) |
50 | | -# project_data["workspace_id"] = f"{added_workspace.workspace_id}" |
51 | | -# project = await create_project( |
52 | | -# client.app, |
53 | | -# project_data, |
54 | | -# user_id=logged_user["id"], |
55 | | -# product_name="osparc", |
56 | | -# ) |
57 | | - |
58 | | -# # # List project in workspace |
59 | | -# # url = ( |
60 | | -# # client.app.router["list_projects"] |
61 | | -# # .url_for() |
62 | | -# # .with_query({"workspace_id": f"{added_workspace.workspace_id}"}) |
63 | | -# # ) |
64 | | -# # resp = await client.get(f"{url}") |
65 | | -# # data, _ = await assert_status(resp, status.HTTP_200_OK) |
66 | | -# # assert len(data) == 1 |
67 | | -# # assert data[0]["uuid"] == project["uuid"] |
68 | | -# # assert data[0]["workspaceId"] == added_workspace.workspace_id |
69 | | -# # assert data[0]["folderId"] is None |
70 | | - |
71 | | -# # # Get project in workspace |
72 | | -# # url = client.app.router["get_project"].url_for(project_id=project["uuid"]) |
73 | | -# # resp = await client.get(f"{url}") |
74 | | -# # data, _ = await assert_status(resp, status.HTTP_200_OK) |
75 | | -# # assert data["uuid"] == project["uuid"] |
76 | | -# # assert data["workspaceId"] == added_workspace.workspace_id |
77 | | -# # assert data["folderId"] is None |
78 | | - |
79 | | -# # Create folder in workspace |
80 | | -# url = client.app.router["create_folder"].url_for() |
81 | | -# resp = await client.post( |
82 | | -# f"{url}", |
83 | | -# json={ |
84 | | -# "name": "Original user folder", |
85 | | -# "workspaceId": f"{added_workspace.workspace_id}", |
86 | | -# }, |
87 | | -# ) |
88 | | -# first_folder, _ = await assert_status(resp, status.HTTP_201_CREATED) |
89 | | - |
90 | | -# # Move project in specific folder in workspace |
91 | | -# url = client.app.router["replace_project_folder"].url_for( |
92 | | -# folder_id=f"{first_folder['folderId']}", |
93 | | -# project_id=f"{project['uuid']}", |
94 | | -# ) |
95 | | -# resp = await client.put(f"{url}") |
96 | | -# await assert_status(resp, status.HTTP_204_NO_CONTENT) |
97 | | - |
98 | 23 |
|
99 | 24 | @pytest.fixture |
100 | 25 | def mock_storage_delete_data_folders(mocker: MockerFixture) -> mock.Mock: |
@@ -219,6 +144,3 @@ async def test_workspaces_full_workflow_deletion( |
219 | 144 | ) |
220 | 145 | resp = await client.delete(f"{url}") |
221 | 146 | await assert_status(resp, status.HTTP_204_NO_CONTENT) |
222 | | - |
223 | | - # TODO: Check if the projects are deleted |
224 | | - print("finished") |
0 commit comments