22
22
from fastapi import FastAPI
23
23
from fastapi .encoders import jsonable_encoder
24
24
from models_library .api_schemas_rpc_async_jobs .async_jobs import AsyncJobResult
25
+ from models_library .api_schemas_rpc_async_jobs .exceptions import JobError
25
26
from models_library .api_schemas_storage import STORAGE_RPC_NAMESPACE
26
27
from models_library .api_schemas_storage .storage_schemas import (
27
28
FileMetaDataGet ,
@@ -98,7 +99,7 @@ async def _request_copy_folders(
98
99
pytest .fail (reason = "Copy folders failed!" )
99
100
100
101
101
- @pytest .mark .xfail (reason = "There is something fishy here MB, GC" )
102
+ # @pytest.mark.xfail(reason="There is something fishy here MB, GC")
102
103
async def test_copy_folders_from_non_existing_project (
103
104
initialized_app : FastAPI ,
104
105
storage_rabbitmq_rpc_client : RabbitMQRPCClient ,
@@ -114,7 +115,9 @@ async def test_copy_folders_from_non_existing_project(
114
115
incorrect_dst_project = deepcopy (dst_project )
115
116
incorrect_dst_project ["uuid" ] = faker .uuid4 ()
116
117
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
+ ):
118
121
await _request_copy_folders (
119
122
storage_rabbitmq_rpc_client ,
120
123
user_id ,
@@ -123,14 +126,10 @@ async def test_copy_folders_from_non_existing_project(
123
126
dst_project ,
124
127
nodes_map = {},
125
128
)
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
+ ):
134
133
await _request_copy_folders (
135
134
storage_rabbitmq_rpc_client ,
136
135
user_id ,
@@ -139,12 +138,6 @@ async def test_copy_folders_from_non_existing_project(
139
138
incorrect_dst_project ,
140
139
nodes_map = {},
141
140
)
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
- # )
148
141
149
142
150
143
async def test_copy_folders_from_empty_project (
0 commit comments