@@ -37,13 +37,18 @@ def test_parse_file_empty_multiple_pages_must_succeed(
3737 file & model metadata.
3838 """
3939 input_path : Path = FILE_TYPES_DIR / "pdf" / "multipage_cut-2.pdf"
40- assert input_path .exists (), f"sample file missing: { input_path } "
4140
42- input_doc = PathInput (input_path )
43- options = InferenceParameters (findoc_model_id )
41+ input_source = PathInput (input_path )
42+ params = InferenceParameters (
43+ model_id = findoc_model_id ,
44+ rag = False ,
45+ raw_text = False ,
46+ polygon = False ,
47+ confidence = False ,
48+ )
4449
4550 response : InferenceResponse = v2_client .enqueue_and_get_inference (
46- input_doc , options
51+ input_source , params
4752 )
4853
4954 assert response is not None
@@ -65,20 +70,26 @@ def test_parse_file_filled_single_page_must_succeed(
6570 Upload a filled single-page JPEG and verify that common fields are present.
6671 """
6772 input_path : Path = PRODUCT_DATA_DIR / "financial_document" / "default_sample.jpg"
68- assert input_path .exists (), f"sample file missing: { input_path } "
6973
70- input_doc = PathInput (input_path )
71- options = InferenceParameters (findoc_model_id )
74+ input_source = PathInput (input_path )
75+ params = InferenceParameters (
76+ model_id = findoc_model_id ,
77+ rag = False ,
78+ raw_text = False ,
79+ polygon = False ,
80+ confidence = False ,
81+ )
7282
7383 response : InferenceResponse = v2_client .enqueue_and_get_inference (
74- input_doc , options
84+ input_source , params
7585 )
7686
7787 assert response is not None
7888 assert response .inference is not None
7989
8090 assert response .inference .file is not None
8191 assert response .inference .file .name == "default_sample.jpg"
92+ assert response .inference .file .page_count == 1
8293
8394 assert response .inference .model is not None
8495 assert response .inference .model .id == findoc_model_id
@@ -96,13 +107,12 @@ def test_invalid_uuid_must_throw_error_422(v2_client: ClientV2) -> None:
96107 Using an invalid model identifier must trigger a 422 HTTP error.
97108 """
98109 input_path : Path = FILE_TYPES_DIR / "pdf" / "multipage_cut-2.pdf"
99- assert input_path .exists ()
100110
101- input_doc = PathInput (input_path )
102- options = InferenceParameters ("INVALID MODEL ID" )
111+ input_source = PathInput (input_path )
112+ params = InferenceParameters (model_id = "INVALID MODEL ID" )
103113
104114 with pytest .raises (MindeeHTTPErrorV2 ) as exc_info :
105- v2_client .enqueue_inference (input_doc , options )
115+ v2_client .enqueue_inference (input_source , params )
106116
107117 exc : MindeeHTTPErrorV2 = exc_info .value
108118 assert exc .status == 422
@@ -119,10 +129,16 @@ def test_url_input_source_must_not_raise_errors(
119129 """
120130 url = os .getenv ("MINDEE_V2_SE_TESTS_BLANK_PDF_URL" )
121131
122- input_doc = UrlInputSource (url )
123- options = InferenceParameters (findoc_model_id )
132+ input_source = UrlInputSource (url )
133+ params = InferenceParameters (
134+ model_id = findoc_model_id ,
135+ rag = False ,
136+ raw_text = False ,
137+ polygon = False ,
138+ confidence = False ,
139+ )
124140 response : InferenceResponse = v2_client .enqueue_and_get_inference (
125- input_doc , options
141+ input_source , params
126142 )
127143 assert response is not None
128144 assert response .inference is not None
0 commit comments