Skip to content

Commit 75a06d5

Browse files
committed
fix test_tasks.py
1 parent 3efc130 commit 75a06d5

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

services/api-server/tests/unit/celery/test_tasks.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
from faker import Faker
1010
from fastapi import status
1111
from httpx import AsyncClient, BasicAuth
12-
from models_library.api_schemas_long_running_tasks.tasks import TaskGet
12+
from models_library.api_schemas_long_running_tasks.tasks import TaskGet, TaskStatus
1313
from models_library.progress_bar import ProgressReport, ProgressStructuredMessage
1414
from pytest_mock import MockerFixture, MockType, mocker
15-
from servicelib.celery.models import TaskState, TaskStatus, TaskUUID
15+
from servicelib.celery.models import TaskState
16+
from servicelib.celery.models import TaskStatus as CeleryTaskStatus
17+
from servicelib.celery.models import TaskUUID
1618
from simcore_service_api_server.api.routes import tasks as task_routes
1719
from simcore_service_api_server.models.schemas.base import ApiServerEnvelope
1820

@@ -55,7 +57,7 @@ async def test_list_celery_tasks(
5557
assert task.status_href == f"/v0/tasks/{task.task_id}"
5658

5759

58-
async def test_get_async_jobs_status(
60+
async def test_get_task_status(
5961
mock_task_manager: MockType,
6062
client: AsyncClient,
6163
auth: BasicAuth,
@@ -67,7 +69,7 @@ async def test_get_async_jobs_status(
6769
TaskStatus.model_validate_json(response.text)
6870

6971

70-
async def test_cancel_async_job(
72+
async def test_cancel_task(
7173
mock_task_manager: MockType,
7274
client: AsyncClient,
7375
auth: BasicAuth,
@@ -78,7 +80,7 @@ async def test_cancel_async_job(
7880
assert response.status_code == status.HTTP_204_NO_CONTENT
7981

8082

81-
async def test_get_result(
83+
async def test_get_task_result(
8284
mock_task_manager: MockType,
8385
client: AsyncClient,
8486
auth: BasicAuth,
@@ -133,7 +135,7 @@ async def test_get_result(
133135
"GET",
134136
f"/v0/tasks/{_faker.uuid4()}/result",
135137
None,
136-
TaskStatus(
138+
CeleryTaskStatus(
137139
task_uuid=TaskUUID("123e4567-e89b-12d3-a456-426614174000"),
138140
task_state=TaskState.STARTED,
139141
progress_report=ProgressReport(
@@ -153,7 +155,7 @@ async def test_get_result(
153155
"GET",
154156
f"/v0/tasks/{_faker.uuid4()}/result",
155157
None,
156-
TaskStatus(
158+
CeleryTaskStatus(
157159
task_uuid=TaskUUID("123e4567-e89b-12d3-a456-426614174000"),
158160
task_state=TaskState.ABORTED,
159161
progress_report=ProgressReport(

0 commit comments

Comments
 (0)