Skip to content

Commit

Permalink
drafting tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Nov 4, 2024
1 parent 88231cd commit 93ae176
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions services/web/server/tests/unit/with_dbs/03/test_trash.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import pytest
from aiohttp.test_utils import TestClient
from aioresponses import aioresponses
from models_library.api_schemas_webserver.folders import FolderGet
from models_library.api_schemas_webserver.projects import ProjectGet, ProjectListItem
from models_library.rest_pagination import Page
from pytest_mock import MockerFixture
Expand Down Expand Up @@ -174,3 +175,27 @@ async def test_trash_projects( # noqa: PLR0915
await asyncio.sleep(0.1)
mock_stop_pipeline.assert_awaited()
mock_remove_dynamic_services.assert_awaited()


@pytest.mark.acceptance_test(
"For https://github.com/ITISFoundation/osparc-simcore/pull/6642"
)
async def test_trash_folders(
client: TestClient,
logged_user: UserInfoDict,
):

# LIST NOT trashed
resp = await client.get("/v0/folders")
await assert_status(resp, status.HTTP_200_OK)

page = Page[FolderGet].parse_obj(await resp.json())
assert page.meta.total == 1

got = page.data[0]
# assert got.uuid == project_uuid
assert got.trashed_at is None

# LIST trashed
resp = await client.get("/v0/folders", params={"filters": '{"trashed": true}'})
await assert_status(resp, status.HTTP_200_OK)

0 comments on commit 93ae176

Please sign in to comment.