Skip to content

Commit ba29032

Browse files
committed
adjusted test code
1 parent fce8c72 commit ba29032

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

services/storage/tests/unit/test_handlers_paths.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import sqlalchemy as sa
1919
from faker import Faker
2020
from fastapi import FastAPI, status
21-
from fastapi_pagination.cursor import CursorPage
2221
from models_library.api_schemas_storage.storage_schemas import (
2322
PathMetaDataGet,
2423
PathTotalSizeCreate,
@@ -30,6 +29,7 @@
3029
from pytest_simcore.helpers.fastapi import url_from_operation_id
3130
from pytest_simcore.helpers.httpx_assert_checks import assert_status
3231
from pytest_simcore.helpers.storage_utils import FileIDDict, ProjectWithFilesParams
32+
from servicelib.fastapi.rest_pagination import CustomizedPathsCursorPage
3333
from simcore_postgres_database.models.projects import projects
3434
from simcore_service_storage.simcore_s3_dsm import SimcoreS3DataManager
3535
from sqlalchemy.ext.asyncio import AsyncEngine
@@ -67,11 +67,12 @@ async def _assert_list_paths(
6767
limit: int = 25,
6868
expected_paths: list[tuple[Path, _IsFile]],
6969
check_total: bool = True,
70-
) -> CursorPage[PathMetaDataGet]:
70+
) -> CustomizedPathsCursorPage[PathMetaDataGet]:
7171
offset = 0
7272
total_expected = len(expected_paths)
7373
next_cursor = 0 # NOTE: this will initialize
7474
total_received = 0
75+
page_of_files = None
7576
while next_cursor is not None:
7677
url = url_from_operation_id(
7778
client, initialized_app, "list_paths", location_id=f"{location_id}"
@@ -89,7 +90,7 @@ async def _assert_list_paths(
8990
page_of_files, _ = assert_status(
9091
response,
9192
status.HTTP_200_OK,
92-
CursorPage[PathMetaDataGet],
93+
CustomizedPathsCursorPage[PathMetaDataGet], # type: ignore
9394
expect_envelope=False,
9495
)
9596
assert page_of_files
@@ -112,6 +113,7 @@ async def _assert_list_paths(
112113
total_received += len(page_of_files.items)
113114
offset += limit
114115
assert total_received == total_expected
116+
assert page_of_files
115117
assert page_of_files.next_page is None
116118
return page_of_files
117119

0 commit comments

Comments
 (0)