Skip to content

Commit 013eb85

Browse files
committed
better functional tests
1 parent cdaef22 commit 013eb85

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

tests/test_client_v2_integration.py

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_parse_file_empty_multiple_pages_must_succeed(
4242
params = InferenceParameters(
4343
model_id=findoc_model_id,
4444
rag=False,
45-
raw_text=False,
45+
raw_text=True,
4646
polygon=False,
4747
confidence=False,
4848
webhook_ids=[],
@@ -58,10 +58,19 @@ def test_parse_file_empty_multiple_pages_must_succeed(
5858

5959
assert response.inference.file is not None
6060
assert response.inference.file.name == "multipage_cut-2.pdf"
61+
assert response.inference.file.page_count == 2
6162

6263
assert response.inference.model is not None
6364
assert response.inference.model.id == findoc_model_id
6465

66+
assert response.inference.active_options is not None
67+
assert response.inference.active_options.rag is False
68+
assert response.inference.active_options.raw_text is True
69+
assert response.inference.active_options.polygon is False
70+
assert response.inference.active_options.confidence is False
71+
72+
assert response.inference.result.raw_text is not None
73+
6574

6675
@pytest.mark.integration
6776
@pytest.mark.v2
@@ -81,7 +90,7 @@ def test_parse_file_filled_single_page_must_succeed(
8190
polygon=False,
8291
confidence=False,
8392
webhook_ids=[],
84-
alias="py_integration_empty_multipage",
93+
alias="py_integration_filled_single",
8594
)
8695

8796
response: InferenceResponse = v2_client.enqueue_and_get_inference(
@@ -95,19 +104,23 @@ def test_parse_file_filled_single_page_must_succeed(
95104
assert response.inference.file.name == "default_sample.jpg"
96105
assert response.inference.file.page_count == 1
97106

107+
assert response.inference.model is not None
108+
assert response.inference.model.id == findoc_model_id
109+
98110
assert response.inference.active_options is not None
99111
assert response.inference.active_options.rag is False
100112
assert response.inference.active_options.raw_text is False
101113
assert response.inference.active_options.polygon is False
102114
assert response.inference.active_options.confidence is False
103115

104-
assert response.inference.model is not None
105-
assert response.inference.model.id == findoc_model_id
116+
assert response.inference.result.raw_text is None
106117

107118
assert response.inference.result is not None
108119
supplier_name = response.inference.result.fields["supplier_name"]
109120
assert supplier_name is not None
110121
assert supplier_name.value == "John Smith"
122+
assert supplier_name.confidence is None
123+
assert len(supplier_name.locations) == 0
111124

112125

113126
@pytest.mark.integration

0 commit comments

Comments
 (0)