Skip to content

Commit 9348f7b

Browse files
author
Andrei Neagu
committed
added corner case
1 parent a3522b6 commit 9348f7b

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

services/storage/tests/unit/test_async_jobs.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
JobError,
2121
)
2222
from models_library.api_schemas_storage import STORAGE_RPC_NAMESPACE
23+
from models_library.api_schemas_storage.export_data_async_jobs import AccessRightError
2324
from models_library.products import ProductName
2425
from models_library.rabbitmq_basic_types import RPCMethodName
2526
from models_library.users import UserID
@@ -84,7 +85,7 @@ async def _process_action(action: str, payload: Any) -> Any:
8485
case Action.ECHO:
8586
return payload
8687
case Action.RAISE:
87-
raise pickle.loads(payload)
88+
raise pickle.loads(payload) # noqa: S301
8889
case Action.SLEEP:
8990
await asyncio.sleep(payload)
9091
return None
@@ -294,8 +295,11 @@ async def test_async_jobs_cancel_(
294295
@pytest.mark.parametrize(
295296
"error",
296297
[
297-
Exception("some generic exception"),
298-
# TODO: figure out if osparc errors are formatted as expected
298+
pytest.param(Exception("generic error"), id="generic-error"),
299+
pytest.param(
300+
AccessRightError(user_id=1, file_id="fake_key", location_id=0),
301+
id="custom-osparc-error",
302+
),
299303
],
300304
)
301305
async def test_async_jobs_raises(

0 commit comments

Comments
 (0)