|
6 | 6 | # pylint: disable=unused-variable |
7 | 7 |
|
8 | 8 |
|
| 9 | +import asyncio |
9 | 10 | from collections.abc import Callable |
10 | 11 | from uuid import UUID |
11 | 12 |
|
@@ -36,17 +37,22 @@ def mocked_catalog( |
36 | 37 | catalog_subsystem_mock([user_project]) |
37 | 38 |
|
38 | 39 |
|
| 40 | +@pytest.fixture |
| 41 | +def mocked_director_v2(director_v2_service_mock: aioresponses): |
| 42 | + ... |
| 43 | + |
| 44 | + |
39 | 45 | @pytest.mark.acceptance_test( |
40 | 46 | "For https://github.com/ITISFoundation/osparc-simcore/pull/6579" |
41 | 47 | ) |
42 | 48 | @pytest.mark.parametrize("force", [False, True]) |
43 | 49 | @pytest.mark.parametrize("is_project_running", [False, True]) |
44 | | -async def test_trash_projects( |
| 50 | +async def test_trash_projects( # noqa: PLR0915 |
45 | 51 | client: TestClient, |
46 | 52 | logged_user: UserInfoDict, |
47 | 53 | user_project: ProjectDict, |
48 | 54 | mocked_catalog: None, |
49 | | - director_v2_service_mock: aioresponses, |
| 55 | + mocked_director_v2: None, |
50 | 56 | mocker: MockerFixture, |
51 | 57 | force: bool, |
52 | 58 | is_project_running: bool, |
@@ -78,6 +84,8 @@ async def test_trash_projects( |
78 | 84 | url = client.app.router["list_projects"].url_for() |
79 | 85 | assert f"{url}" == "/v0/projects" |
80 | 86 |
|
| 87 | + # --------------------------------------------------------------------- |
| 88 | + |
81 | 89 | # LIST NOT trashed |
82 | 90 | resp = await client.get("/v0/projects") |
83 | 91 | await assert_status(resp, status.HTTP_200_OK) |
@@ -151,5 +159,7 @@ async def test_trash_projects( |
151 | 159 | assert got.trashed_at is None |
152 | 160 |
|
153 | 161 | 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