Skip to content

Commit 907712d

Browse files
committed
fixes coro
1 parent 075c804 commit 907712d

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

services/web/server/tests/unit/with_dbs/03/test_trash.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# pylint: disable=unused-variable
77

88

9+
import asyncio
910
from collections.abc import Callable
1011
from uuid import UUID
1112

@@ -36,17 +37,22 @@ def mocked_catalog(
3637
catalog_subsystem_mock([user_project])
3738

3839

40+
@pytest.fixture
41+
def mocked_director_v2(director_v2_service_mock: aioresponses):
42+
...
43+
44+
3945
@pytest.mark.acceptance_test(
4046
"For https://github.com/ITISFoundation/osparc-simcore/pull/6579"
4147
)
4248
@pytest.mark.parametrize("force", [False, True])
4349
@pytest.mark.parametrize("is_project_running", [False, True])
44-
async def test_trash_projects(
50+
async def test_trash_projects( # noqa: PLR0915
4551
client: TestClient,
4652
logged_user: UserInfoDict,
4753
user_project: ProjectDict,
4854
mocked_catalog: None,
49-
director_v2_service_mock: aioresponses,
55+
mocked_director_v2: None,
5056
mocker: MockerFixture,
5157
force: bool,
5258
is_project_running: bool,
@@ -78,6 +84,8 @@ async def test_trash_projects(
7884
url = client.app.router["list_projects"].url_for()
7985
assert f"{url}" == "/v0/projects"
8086

87+
# ---------------------------------------------------------------------
88+
8189
# LIST NOT trashed
8290
resp = await client.get("/v0/projects")
8391
await assert_status(resp, status.HTTP_200_OK)
@@ -151,5 +159,7 @@ async def test_trash_projects(
151159
assert got.trashed_at is None
152160

153161
if is_project_running and force:
154-
mock_remove_dynamic_services.assert_any_await()
155-
mock_stop_pipeline.assert_any_await()
162+
# checks fire&forget calls
163+
await asyncio.sleep(0.1)
164+
mock_stop_pipeline.assert_awaited()
165+
mock_remove_dynamic_services.assert_awaited()

0 commit comments

Comments
 (0)