Skip to content

Commit b0bb2fe

Browse files
add final tests
1 parent 48d2677 commit b0bb2fe

File tree

2 files changed

+1
-79
lines changed

2 files changed

+1
-79
lines changed

services/web/server/src/simcore_service_webserver/folders/_trash_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def _can_delete(
211211
folder_db.trashed
212212
and (until_equal_datetime is None or folder_db.trashed < until_equal_datetime)
213213
and my_access_rights.delete
214-
and folder_db.trashed_by == user_id # <-- Ask PC - is this correct?
214+
and folder_db.trashed_by == user_id
215215
and folder_db.trashed_explicitly
216216
)
217217

services/web/server/tests/unit/with_dbs/04/workspaces/test_workspaces__delete_workspace_with_content.py

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -20,81 +20,6 @@
2020
from simcore_service_webserver.db.models import UserRole
2121
from simcore_service_webserver.projects.models import ProjectDict
2222

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-
9823

9924
@pytest.fixture
10025
def mock_storage_delete_data_folders(mocker: MockerFixture) -> mock.Mock:
@@ -219,6 +144,3 @@ async def test_workspaces_full_workflow_deletion(
219144
)
220145
resp = await client.delete(f"{url}")
221146
await assert_status(resp, status.HTTP_204_NO_CONTENT)
222-
223-
# TODO: Check if the projects are deleted
224-
print("finished")

0 commit comments

Comments
 (0)