6161from tenacity .retry import retry_if_exception_type
6262from tenacity .stop import stop_after_delay
6363from tenacity .wait import wait_fixed
64+ from tests .fixtures .data_models import FileIDDict
65+ from tests .helpers .utils_file_meta_data import assert_file_meta_data_in_db
6466from types_aiobotocore_s3 import S3Client
6567from yarl import URL
6668
67- from tests .helpers .utils_file_meta_data import assert_file_meta_data_in_db
68-
6969pytest_simcore_core_services_selection = ["postgres" ]
7070pytest_simcore_ops_services_selection = ["adminer" ]
7171
@@ -91,14 +91,14 @@ async def assert_multipart_uploads_in_progress(
9191 tuple [UploadID , S3ObjectKey ]
9292 ] = await storage_s3_client .list_ongoing_multipart_uploads (bucket = storage_s3_bucket )
9393 if expected_upload_ids is None :
94- assert not list_uploads , (
95- f"expected NO multipart uploads in progress, got { list_uploads } "
96- )
94+ assert (
95+ not list_uploads
96+ ), f"expected NO multipart uploads in progress, got { list_uploads } "
9797 else :
9898 for upload_id , _ in list_uploads :
99- assert upload_id in expected_upload_ids , (
100- f" { upload_id = } is in progress but was not expected!"
101- )
99+ assert (
100+ upload_id in expected_upload_ids
101+ ), f" { upload_id = } is in progress but was not expected!"
102102
103103
104104@dataclass
@@ -209,9 +209,9 @@ async def _link_creator(file_id: SimcoreS3FileID, **query_kwargs) -> PresignedLi
209209 location_id = f"{ location_id } " ,
210210 file_id = file_id ,
211211 ).with_query (** query_kwargs , user_id = user_id )
212- assert "file_size" not in url . query , (
213- "v1 call to upload_file MUST NOT contain file_size field, this is reserved for v2 call"
214- )
212+ assert (
213+ "file_size" not in url . query
214+ ), "v1 call to upload_file MUST NOT contain file_size field, this is reserved for v2 call"
215215 response = await client .put (f"{ url } " )
216216 received_file_upload_link , error = assert_status (
217217 response , status .HTTP_200_OK , PresignedLink
@@ -390,9 +390,9 @@ async def test_create_upload_file_presigned_with_file_size_returns_multipart_lin
390390 file_size = f"{ test_param .file_size } " ,
391391 )
392392 # number of links
393- assert len ( received_file_upload . urls ) == test_param . expected_num_links , (
394- f" { len (received_file_upload .urls )} vs { test_param .expected_num_links = } "
395- )
393+ assert (
394+ len (received_file_upload .urls ) == test_param .expected_num_links
395+ ), f" { len ( received_file_upload . urls ) } vs { test_param . expected_num_links = } "
396396 # all links are unique
397397 assert len (set (received_file_upload .urls )) == len (received_file_upload .urls )
398398 assert received_file_upload .chunk_size == test_param .expected_chunk_size
@@ -547,9 +547,9 @@ async def test_upload_same_file_uuid_aborts_previous_upload(
547547 expected_sha256_checksum = None ,
548548 )
549549 if expect_upload_id and link_type == LinkType .PRESIGNED :
550- assert upload_id != new_upload_id , (
551- "There shall be a new upload id after a new call to create_upload_file"
552- )
550+ assert (
551+ upload_id != new_upload_id
552+ ), "There shall be a new upload id after a new call to create_upload_file"
553553 elif expect_upload_id and link_type == LinkType .S3 :
554554 assert upload_id == new_upload_id
555555 assert upload_id == S3_UNDEFINED_OR_EXTERNAL_MULTIPART_ID
@@ -1483,7 +1483,7 @@ async def test_listing_with_project_id_filter(
14831483 Awaitable [
14841484 tuple [
14851485 ProjectAtDB ,
1486- dict [NodeID , dict [SimcoreS3FileID , dict [ str , Path | str ] ]],
1486+ dict [NodeID , dict [SimcoreS3FileID , FileIDDict ]],
14871487 ]
14881488 ],
14891489 ],
0 commit comments