2222from fastapi import FastAPI
2323from fastapi .encoders import jsonable_encoder
2424from models_library .api_schemas_rpc_async_jobs .async_jobs import AsyncJobResult
25+ from models_library .api_schemas_rpc_async_jobs .exceptions import JobError
2526from models_library .api_schemas_storage import STORAGE_RPC_NAMESPACE
2627from models_library .api_schemas_storage .storage_schemas import (
2728 FileMetaDataGet ,
@@ -98,7 +99,7 @@ async def _request_copy_folders(
9899 pytest .fail (reason = "Copy folders failed!" )
99100
100101
101- @pytest .mark .xfail (reason = "There is something fishy here MB, GC" )
102+ # @pytest.mark.xfail(reason="There is something fishy here MB, GC")
102103async def test_copy_folders_from_non_existing_project (
103104 initialized_app : FastAPI ,
104105 storage_rabbitmq_rpc_client : RabbitMQRPCClient ,
@@ -114,7 +115,9 @@ async def test_copy_folders_from_non_existing_project(
114115 incorrect_dst_project = deepcopy (dst_project )
115116 incorrect_dst_project ["uuid" ] = faker .uuid4 ()
116117
117- with pytest .raises (RuntimeError , match = "404" ) as exc_info :
118+ with pytest .raises (
119+ JobError , match = f"Project { incorrect_src_project ['uuid' ]} was not found"
120+ ):
118121 await _request_copy_folders (
119122 storage_rabbitmq_rpc_client ,
120123 user_id ,
@@ -123,14 +126,10 @@ async def test_copy_folders_from_non_existing_project(
123126 dst_project ,
124127 nodes_map = {},
125128 )
126- # assert_status(
127- # exc_info.value.response,
128- # status.HTTP_404_NOT_FOUND,
129- # None,
130- # expected_msg=f"{incorrect_src_project['uuid']} was not found",
131- # )
132-
133- with pytest .raises (RuntimeError , match = "404" ) as exc_info :
129+
130+ with pytest .raises (
131+ JobError , match = f"Project { incorrect_dst_project ['uuid' ]} was not found"
132+ ):
134133 await _request_copy_folders (
135134 storage_rabbitmq_rpc_client ,
136135 user_id ,
@@ -139,12 +138,6 @@ async def test_copy_folders_from_non_existing_project(
139138 incorrect_dst_project ,
140139 nodes_map = {},
141140 )
142- # assert_status(
143- # exc_info.value.response,
144- # status.HTTP_404_NOT_FOUND,
145- # None,
146- # expected_msg=f"{incorrect_dst_project['uuid']} was not found",
147- # )
148141
149142
150143async def test_copy_folders_from_empty_project (
0 commit comments