Skip to content

Commit 799b391

Browse files
committed
renames
1 parent ae8ce24 commit 799b391

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

services/api-server/src/simcore_service_api_server/_service_studies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
DEFAULT_PAGINATION_LIMIT = MAXIMUM_NUMBER_OF_ITEMS_PER_PAGE - 1
1414

1515

16-
class StudiesService:
16+
class StudyService:
1717
_job_service: JobService
1818

1919
def __init__(

services/api-server/src/simcore_service_api_server/api/dependencies/services.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from models_library.products import ProductName
88
from models_library.users import UserID
99
from servicelib.rabbitmq import RabbitMQRPCClient
10-
from simcore_service_api_server._service_studies import StudiesService
10+
from simcore_service_api_server._service_studies import StudyService
1111

1212
from ..._service_jobs import JobService
1313
from ..._service_solvers import SolverService
@@ -88,9 +88,9 @@ def get_solver_service(
8888
)
8989

9090

91-
def get_studies_service(
91+
def get_study_service(
9292
job_service: Annotated[JobService, Depends(get_job_service)],
93-
) -> StudiesService:
94-
return StudiesService(
93+
) -> StudyService:
94+
return StudyService(
9595
job_service=job_service,
9696
)

services/api-server/src/simcore_service_api_server/api/routes/studies_jobs.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pydantic import HttpUrl, PositiveInt
1818
from pydantic.types import PositiveInt
1919
from servicelib.logging_utils import log_context
20-
from simcore_service_api_server._service_studies import StudiesService
20+
from simcore_service_api_server._service_studies import StudyService
2121
from simcore_service_api_server.models.api_resources import parse_resources_ids
2222

2323
from ...exceptions.backend_errors import ProjectAlreadyStartedError
@@ -51,7 +51,7 @@
5151
from ...services_rpc.wb_api_server import WbApiRpcClient
5252
from ..dependencies.application import get_reverse_url_mapper
5353
from ..dependencies.authentication import get_current_user_id, get_product_name
54-
from ..dependencies.services import get_api_client, get_studies_service
54+
from ..dependencies.services import get_api_client, get_study_service
5555
from ..dependencies.webserver_http import AuthSession, get_webserver_session
5656
from ..dependencies.webserver_rpc import (
5757
get_wb_api_rpc_client,
@@ -97,13 +97,13 @@ def _compose_job_resource_name(study_key, job_id) -> str:
9797
async def list_study_jobs(
9898
study_id: StudyID,
9999
page_params: Annotated[PaginationParams, Depends()],
100-
studies_service: Annotated[StudiesService, Depends(get_studies_service)],
100+
study_service: Annotated[StudyService, Depends(get_study_service)],
101101
url_for: Annotated[Callable, Depends(get_reverse_url_mapper)],
102102
):
103103
msg = f"list study jobs study_id={study_id!r} with pagination={page_params!r}. SEE https://github.com/ITISFoundation/osparc-simcore/issues/4177"
104104
_logger.debug(msg)
105105

106-
jobs, meta = await studies_service.list_jobs(
106+
jobs, meta = await study_service.list_jobs(
107107
study_id=study_id,
108108
offset=page_params.offset,
109109
limit=page_params.limit,

services/api-server/tests/unit/test_service_solvers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
@pytest.fixture
1818
def job_service(
1919
mocker: MockerFixture,
20+
mocked_webserver_rest_api_base: dict[str, MockType],
2021
mocked_webserver_rpc_api: dict[str, MockType],
2122
product_name: ProductName,
2223
user_id: UserID,
@@ -65,14 +66,9 @@ async def test_get_solver(
6566
async def test_list_jobs(
6667
solver_service: SolverService,
6768
mocked_webserver_rpc_api: dict[str, MockType],
68-
product_name: ProductName,
69-
user_id: UserID,
7069
):
7170
# Test default parameters
72-
jobs, page_meta = await solver_service.list_jobs(
73-
user_id=user_id,
74-
product_name=product_name,
75-
)
71+
jobs, page_meta = await solver_service.list_jobs()
7672
assert isinstance(jobs, list)
7773
mocked_webserver_rpc_api["list_projects_marked_as_jobs"].assert_called_once()
7874
assert page_meta.total >= 0

0 commit comments

Comments
 (0)