File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
src/simcore_service_webserver/projects/_common Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11import logging
22
33from servicelib .aiohttp import status
4- from servicelib .rabbitmq .rpc_interfaces .catalog .errors import CatalogForbiddenError
4+ from servicelib .rabbitmq .rpc_interfaces .catalog .errors import (
5+ CatalogForbiddenError ,
6+ CatalogItemNotFoundError ,
7+ )
58
69from ...exception_handling import (
710 ExceptionToHttpErrorMap ,
166169 status .HTTP_403_FORBIDDEN ,
167170 "Catalog forbidden: Insufficient access rights for {name}" ,
168171 ),
172+ CatalogItemNotFoundError : HttpErrorInfo (
173+ status .HTTP_404_NOT_FOUND , "{name} was not found"
174+ ),
169175}
170176
171177_TO_HTTP_ERROR_MAP : ExceptionToHttpErrorMap = {}
Original file line number Diff line number Diff line change @@ -356,7 +356,7 @@ async def test_patch_project_node_service_key_with_error(
356356):
357357 node_id = next (iter (user_project ["workbench" ]))
358358 assert client .app
359- base_url = client .app .router ["patch_project_node" ].url_for (
359+ url = client .app .router ["patch_project_node" ].url_for (
360360 project_id = user_project ["uuid" ], node_id = node_id
361361 )
362362 _patch_version = {"version" : "2.0.9" }
@@ -365,12 +365,12 @@ async def test_patch_project_node_service_key_with_error(
365365 "simcore_service_webserver.projects.projects_service.catalog_rpc.check_for_service" ,
366366 side_effect = CatalogForbiddenError (name = "test" ),
367367 ):
368- resp = await client .patch (f"{ base_url } " , json = _patch_version )
368+ resp = await client .patch (f"{ url } " , json = _patch_version )
369369 assert resp .status == status .HTTP_403_FORBIDDEN
370370
371371 with mocker .patch (
372372 "simcore_service_webserver.projects.projects_service.catalog_rpc.check_for_service" ,
373373 side_effect = CatalogItemNotFoundError (name = "test" ),
374374 ):
375- resp = await client .patch (f"{ base_url } " , json = _patch_version )
375+ resp = await client .patch (f"{ url } " , json = _patch_version )
376376 assert resp .status == status .HTTP_404_NOT_FOUND
You can’t perform that action at this time.
0 commit comments