@@ -161,7 +161,7 @@ def test_invalid_uuid_must_throw_error_422(v2_client: ClientV2) -> None:
161
161
"""
162
162
Using an invalid model identifier must trigger a 422 HTTP error.
163
163
"""
164
- input_path : Path = FILE_TYPES_DIR / "pdf" / "multipage_cut-2 .pdf"
164
+ input_path : Path = FILE_TYPES_DIR / "pdf" / "blank_1 .pdf"
165
165
166
166
input_source = PathInput (input_path )
167
167
params = InferenceParameters (model_id = "INVALID MODEL ID" )
@@ -173,6 +173,55 @@ def test_invalid_uuid_must_throw_error_422(v2_client: ClientV2) -> None:
173
173
assert exc .status == 422
174
174
175
175
176
+ @pytest .mark .integration
177
+ @pytest .mark .v2
178
+ def test_unknown_model_must_throw_error_404 (v2_client : ClientV2 ) -> None :
179
+ """
180
+ Using an unknown model identifier must trigger a 404 HTTP error.
181
+ """
182
+ input_path : Path = FILE_TYPES_DIR / "pdf" / "blank_1.pdf"
183
+
184
+ input_source = PathInput (input_path )
185
+ params = InferenceParameters (model_id = "fc405e37-4ba4-4d03-aeba-533a8d1f0f21" )
186
+
187
+ with pytest .raises (MindeeHTTPErrorV2 ) as exc_info :
188
+ v2_client .enqueue_inference (input_source , params )
189
+
190
+ exc : MindeeHTTPErrorV2 = exc_info .value
191
+ assert exc .status == 404
192
+
193
+
194
+ @pytest .mark .integration
195
+ @pytest .mark .v2
196
+ def test_unknown_webhook_ids_must_throw_error_404 (
197
+ v2_client : ClientV2 , findoc_model_id : str
198
+ ) -> None :
199
+ """
200
+ Using an unknown webhook identifier must trigger a 404 HTTP error.
201
+ """
202
+ input_path : Path = FILE_TYPES_DIR / "pdf" / "blank_1.pdf"
203
+
204
+ input_source = PathInput (input_path )
205
+ params = InferenceParameters (
206
+ model_id = findoc_model_id ,
207
+ webhook_ids = [
208
+ "fc405e37-4ba4-4d03-aeba-533a8d1f0f21" ,
209
+ "fc405e37-4ba4-4d03-aeba-533a8d1f0f21" ,
210
+ ],
211
+ rag = None ,
212
+ raw_text = None ,
213
+ polygon = None ,
214
+ confidence = None ,
215
+ )
216
+
217
+ with pytest .raises (MindeeHTTPErrorV2 ) as exc_info :
218
+ v2_client .enqueue_inference (input_source , params )
219
+
220
+ exc : MindeeHTTPErrorV2 = exc_info .value
221
+ assert exc .status == 422
222
+ assert "no matching webhooks" in exc .detail .lower ()
223
+
224
+
176
225
@pytest .mark .integration
177
226
@pytest .mark .v2
178
227
def test_url_input_source_must_not_raise_errors (
0 commit comments