File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed
models-library/src/models_library/api_schemas_catalog
service-library/src/servicelib/rabbitmq/rpc_interfaces/catalog
services/catalog/tests/unit/with_dbs Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -427,6 +427,39 @@ class MyServicesRpcBatchGet(
427427):
428428 """Result for batch get user services operations"""
429429
430+ @staticmethod
431+ def _update_json_schema_extra (schema : JsonDict ) -> None :
432+ missing : Any = [("simcore/services/comp/itis/sleeper" , "100.2.3" )]
433+ schema .update (
434+ {
435+ "examples" : [
436+ {
437+ "found_items" : [
438+ {
439+ "key" : "simcore/services/comp/itis/sleeper" ,
440+ "release" : {
441+ "version" : "2.2.1" ,
442+ "version_display" : "Summer Release" ,
443+ "released" : "2024-07-21T15:00:00" ,
444+ },
445+ "owner" : 42 ,
446+ "my_access_rights" : {
447+ "execute" : True ,
448+ "write" : False ,
449+ },
450+ }
451+ ],
452+ "missing_identifiers" : missing ,
453+ }
454+ ]
455+ }
456+ )
457+
458+ model_config = ConfigDict (
459+ extra = "forbid" ,
460+ json_schema_extra = _update_json_schema_extra ,
461+ )
462+
430463
431464class ServiceListFilters (Filters ):
432465 service_type : Annotated [
Original file line number Diff line number Diff line change @@ -19,3 +19,7 @@ class CatalogForbiddenError(CatalogApiBaseError):
1919
2020class CatalogNotAvailableError (CatalogApiBaseError ):
2121 msg_template = "Catalog service failed unexpectedly"
22+
23+
24+ class CatalogBadRequestError (CatalogApiBaseError ):
25+ msg_template = "Bad request on {name}: {reason}"
Original file line number Diff line number Diff line change @@ -608,13 +608,16 @@ async def test_rpc_batch_get_my_services(
608608 (other_service_key , other_service_version ),
609609 ]
610610
611- my_services = await catalog_rpc .batch_get_my_services (
611+ batch_got = await catalog_rpc .batch_get_my_services (
612612 rpc_client ,
613613 product_name = product_name ,
614614 user_id = user_id ,
615615 ids = ids ,
616616 )
617617
618+ my_services = batch_got .found_items
619+ assert batch_got .missing_identifiers == []
620+
618621 assert len (my_services ) == 2
619622
620623 # Check access rights to all of them
You can’t perform that action at this time.
0 commit comments