Skip to content

Commit

Permalink
fixes coro
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Oct 25, 2024
1 parent 075c804 commit 907712d
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions services/web/server/tests/unit/with_dbs/03/test_trash.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# pylint: disable=unused-variable


import asyncio
from collections.abc import Callable
from uuid import UUID

Expand Down Expand Up @@ -36,17 +37,22 @@ def mocked_catalog(
catalog_subsystem_mock([user_project])


@pytest.fixture
def mocked_director_v2(director_v2_service_mock: aioresponses):
...


@pytest.mark.acceptance_test(
"For https://github.com/ITISFoundation/osparc-simcore/pull/6579"
)
@pytest.mark.parametrize("force", [False, True])
@pytest.mark.parametrize("is_project_running", [False, True])
async def test_trash_projects(
async def test_trash_projects( # noqa: PLR0915
client: TestClient,
logged_user: UserInfoDict,
user_project: ProjectDict,
mocked_catalog: None,
director_v2_service_mock: aioresponses,
mocked_director_v2: None,
mocker: MockerFixture,
force: bool,
is_project_running: bool,
Expand Down Expand Up @@ -78,6 +84,8 @@ async def test_trash_projects(
url = client.app.router["list_projects"].url_for()
assert f"{url}" == "/v0/projects"

# ---------------------------------------------------------------------

# LIST NOT trashed
resp = await client.get("/v0/projects")
await assert_status(resp, status.HTTP_200_OK)
Expand Down Expand Up @@ -151,5 +159,7 @@ async def test_trash_projects(
assert got.trashed_at is None

if is_project_running and force:
mock_remove_dynamic_services.assert_any_await()
mock_stop_pipeline.assert_any_await()
# checks fire&forget calls
await asyncio.sleep(0.1)
mock_stop_pipeline.assert_awaited()
mock_remove_dynamic_services.assert_awaited()

0 comments on commit 907712d

Please sign in to comment.