1818import sqlalchemy as sa
1919from faker import Faker
2020from fastapi import FastAPI , status
21- from fastapi_pagination .cursor import CursorPage
2221from models_library .api_schemas_storage .storage_schemas import (
2322 PathMetaDataGet ,
2423 PathTotalSizeCreate ,
3029from pytest_simcore .helpers .fastapi import url_from_operation_id
3130from pytest_simcore .helpers .httpx_assert_checks import assert_status
3231from pytest_simcore .helpers .storage_utils import FileIDDict , ProjectWithFilesParams
32+ from servicelib .fastapi .rest_pagination import CustomizedPathsCursorPage
3333from simcore_postgres_database .models .projects import projects
3434from simcore_service_storage .simcore_s3_dsm import SimcoreS3DataManager
3535from 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