Skip to content

Commit 79bac48

Browse files
committed
total not anymore optional
1 parent d8b856f commit 79bac48

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

services/web/server/tests/unit/with_dbs/01/storage/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from faker import Faker
1717
from fastapi import APIRouter, Depends, FastAPI, Request, status
1818
from fastapi_pagination import add_pagination, create_page
19-
from fastapi_pagination.cursor import CursorPage, CursorParams
19+
from fastapi_pagination.cursor import CursorParams
2020
from models_library.api_schemas_storage.storage_schemas import (
2121
DatasetMetaDataGet,
2222
FileLocation,
@@ -35,6 +35,7 @@
3535
from pydantic import AnyUrl, TypeAdapter
3636
from pytest_simcore.helpers.logging_tools import log_context
3737
from pytest_simcore.helpers.monkeypatch_envs import setenvs_from_dict
38+
from servicelib.fastapi.rest_pagination import CustomizedPathsCursorPage
3839
from servicelib.utils import unused_port
3940
from yarl import URL
4041

@@ -74,7 +75,7 @@ async def _list_storage_locations(user_id: UserID, request: Request):
7475

7576
@router.get(
7677
"/locations/{location_id}/paths",
77-
response_model=CursorPage[PathMetaDataGet],
78+
response_model=CustomizedPathsCursorPage[PathMetaDataGet],
7879
)
7980
async def _list_paths(
8081
page_params: Annotated[CursorParams, Depends()],

services/web/server/tests/unit/with_dbs/01/storage/test_storage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import pytest
1212
from aiohttp.test_utils import TestClient
1313
from faker import Faker
14-
from fastapi_pagination.cursor import CursorPage
1514
from models_library.api_schemas_long_running_tasks.tasks import (
1615
TaskGet,
1716
TaskResult,
@@ -56,6 +55,7 @@
5655
from pytest_simcore.helpers.assert_checks import assert_status
5756
from pytest_simcore.helpers.webserver_users import UserInfoDict
5857
from servicelib.aiohttp import status
58+
from servicelib.fastapi.rest_pagination import CustomizedPathsCursorPage
5959
from servicelib.rabbitmq.rpc_interfaces.async_jobs import async_jobs
6060
from servicelib.rabbitmq.rpc_interfaces.async_jobs.async_jobs import (
6161
submit,
@@ -138,7 +138,7 @@ async def test_list_storage_paths(
138138
resp = await client.get(f"{url}")
139139
data, error = await assert_status(resp, expected)
140140
if not error:
141-
TypeAdapter(CursorPage[PathMetaDataGet]).validate_python(data)
141+
TypeAdapter(CustomizedPathsCursorPage[PathMetaDataGet]).validate_python(data)
142142

143143

144144
_faker = Faker()
@@ -485,7 +485,7 @@ async def test_export_data(
485485
)
486486

487487
_body = DataExportPost(
488-
paths=[f"{faker.uuid4()}/{faker.uuid4()}/{faker.file_name()}"]
488+
paths=[Path(f"{faker.uuid4()}/{faker.uuid4()}/{faker.file_name()}")]
489489
)
490490
response = await client.post(
491491
f"/{API_VERSION}/storage/locations/0/export-data", data=_body.model_dump_json()

0 commit comments

Comments
 (0)