2626from models_library .users import UserID
2727from pydantic import ByteSize , TypeAdapter
2828from pytest_simcore .helpers .storage_utils import FileIDDict , ProjectWithFilesParams
29- from servicelib .celery .models import OwnerMetadata
29+ from servicelib .celery .models import OwnerMetadata , Wildcard
3030from servicelib .rabbitmq ._client_rpc import RabbitMQRPCClient
3131from servicelib .rabbitmq .rpc_interfaces .async_jobs .async_jobs import (
3232 wait_and_get_result ,
4343_IsFile : TypeAlias = bool
4444
4545
46+ class TestOwnerMetadata (OwnerMetadata ):
47+ user_id : int | Wildcard
48+ product_name : str | Wildcard
49+
50+
4651def _filter_and_group_paths_one_level_deeper (
4752 paths : list [Path ], prefix : Path
4853) -> list [tuple [Path , _IsFile ]]:
@@ -73,17 +78,18 @@ async def _assert_compute_path_size(
7378 storage_rpc_client ,
7479 location_id = location_id ,
7580 path = path ,
76- owner_metadata = OwnerMetadata (
77- user_id = user_id , product_name = product_name , owner = "PYTEST_CLIENT_NAME "
81+ owner_metadata = TestOwnerMetadata (
82+ user_id = user_id , product_name = product_name , owner = "pytest_client_name "
7883 ),
84+ user_id = user_id ,
7985 )
8086 async for job_composed_result in wait_and_get_result (
8187 storage_rpc_client ,
8288 rpc_namespace = STORAGE_RPC_NAMESPACE ,
8389 method_name = RPCMethodName (compute_path_size .__name__ ),
8490 job_id = async_job .job_id ,
85- owner_metadata = OwnerMetadata (
86- user_id = user_id , product_name = product_name , owner = "PYTEST_CLIENT_NAME "
91+ owner_metadata = TestOwnerMetadata (
92+ user_id = user_id , product_name = product_name , owner = "pytest_client_name "
8793 ),
8894 client_timeout = datetime .timedelta (seconds = 120 ),
8995 ):
@@ -110,17 +116,18 @@ async def _assert_delete_paths(
110116 storage_rpc_client ,
111117 location_id = location_id ,
112118 paths = paths ,
113- owner_metadata = OwnerMetadata (
114- user_id = user_id , product_name = product_name , owner = "PYTEST_CLIENT_NAME "
119+ owner_metadata = TestOwnerMetadata (
120+ user_id = user_id , product_name = product_name , owner = "pytest_client_name "
115121 ),
122+ user_id = user_id ,
116123 )
117124 async for job_composed_result in wait_and_get_result (
118125 storage_rpc_client ,
119126 rpc_namespace = STORAGE_RPC_NAMESPACE ,
120127 method_name = RPCMethodName (compute_path_size .__name__ ),
121128 job_id = async_job .job_id ,
122- owner_metadata = OwnerMetadata (
123- user_id = user_id , product_name = product_name , owner = "PYTEST_CLIENT_NAME "
129+ owner_metadata = TestOwnerMetadata (
130+ user_id = user_id , product_name = product_name , owner = "pytest_client_name "
124131 ),
125132 client_timeout = datetime .timedelta (seconds = 120 ),
126133 ):
0 commit comments