66from mindee import ClientV2 , InferenceParameters , PathInput , UrlInputSource
77from mindee .error .mindee_http_error_v2 import MindeeHTTPErrorV2
88from mindee .parsing .v2 .inference_response import InferenceResponse
9- from tests .utils import FILE_TYPES_DIR , V1_PRODUCT_DATA_DIR
9+ from tests .utils import FILE_TYPES_DIR , V2_PRODUCT_DATA_DIR
1010
1111
1212@pytest .fixture (scope = "session" )
@@ -43,14 +43,12 @@ def test_parse_file_empty_multiple_pages_must_succeed(
4343 raw_text = True ,
4444 polygon = False ,
4545 confidence = False ,
46- webhook_ids = [],
4746 alias = "py_integration_empty_multiple" ,
4847 )
4948
5049 response : InferenceResponse = v2_client .enqueue_and_get_inference (
5150 input_source , params
5251 )
53-
5452 assert response is not None
5553 assert response .inference is not None
5654
@@ -67,6 +65,8 @@ def test_parse_file_empty_multiple_pages_must_succeed(
6765 assert response .inference .active_options .polygon is False
6866 assert response .inference .active_options .confidence is False
6967
68+ assert response .inference .result is not None
69+
7070 assert response .inference .result .raw_text is not None
7171 assert len (response .inference .result .raw_text .pages ) == 2
7272
@@ -88,19 +88,29 @@ def test_parse_file_empty_single_page_options_must_succeed(
8888 raw_text = True ,
8989 polygon = True ,
9090 confidence = True ,
91- webhook_ids = [],
9291 alias = "py_integration_empty_page_options" ,
9392 )
9493 response : InferenceResponse = v2_client .enqueue_and_get_inference (
9594 input_source , params
9695 )
96+ assert response is not None
97+ assert response .inference is not None
98+
99+ assert response .inference .model is not None
100+ assert response .inference .model .id == findoc_model_id
101+
102+ assert response .inference .file is not None
103+ assert response .inference .file .name == "blank_1.pdf"
104+ assert response .inference .file .page_count == 1
97105
98106 assert response .inference .active_options is not None
99107 assert response .inference .active_options .rag is True
100108 assert response .inference .active_options .raw_text is True
101109 assert response .inference .active_options .polygon is True
102110 assert response .inference .active_options .confidence is True
103111
112+ assert response .inference .result is not None
113+
104114
105115@pytest .mark .integration
106116@pytest .mark .v2
@@ -110,7 +120,7 @@ def test_parse_file_filled_single_page_must_succeed(
110120 """
111121 Upload a filled single-page JPEG and verify that common fields are present.
112122 """
113- input_path : Path = V1_PRODUCT_DATA_DIR / "financial_document" / "default_sample.jpg"
123+ input_path : Path = V2_PRODUCT_DATA_DIR / "financial_document" / "default_sample.jpg"
114124
115125 input_source = PathInput (input_path )
116126 params = InferenceParameters (
@@ -222,7 +232,7 @@ def test_unknown_webhook_ids_must_throw_error(
222232
223233@pytest .mark .integration
224234@pytest .mark .v2
225- def test_url_input_source_must_not_raise_errors (
235+ def test_blank_url_input_source_must_succeed (
226236 v2_client : ClientV2 ,
227237 findoc_model_id : str ,
228238) -> None :
@@ -246,3 +256,13 @@ def test_url_input_source_must_not_raise_errors(
246256 )
247257 assert response is not None
248258 assert response .inference is not None
259+
260+ assert response .inference .file is not None
261+ assert response .inference .file .page_count == 1
262+
263+ assert response .inference .model is not None
264+ assert response .inference .model .id == findoc_model_id
265+
266+ assert response .inference .result is not None
267+
268+ assert response .inference .active_options is not None
0 commit comments