Skip to content

Commit a753ae1

Browse files
committed
better functional tests
1 parent cdaef22 commit a753ae1

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tests/test_client_v2_integration.py

Lines changed: 18 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,20 @@ 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+
assert len(response.inference.result.raw_text.pages) == 2
74+
6575

6676
@pytest.mark.integration
6777
@pytest.mark.v2
@@ -81,7 +91,7 @@ def test_parse_file_filled_single_page_must_succeed(
8191
polygon=False,
8292
confidence=False,
8393
webhook_ids=[],
84-
alias="py_integration_empty_multipage",
94+
alias="py_integration_filled_single",
8595
)
8696

8797
response: InferenceResponse = v2_client.enqueue_and_get_inference(
@@ -95,19 +105,23 @@ def test_parse_file_filled_single_page_must_succeed(
95105
assert response.inference.file.name == "default_sample.jpg"
96106
assert response.inference.file.page_count == 1
97107

108+
assert response.inference.model is not None
109+
assert response.inference.model.id == findoc_model_id
110+
98111
assert response.inference.active_options is not None
99112
assert response.inference.active_options.rag is False
100113
assert response.inference.active_options.raw_text is False
101114
assert response.inference.active_options.polygon is False
102115
assert response.inference.active_options.confidence is False
103116

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

107119
assert response.inference.result is not None
108120
supplier_name = response.inference.result.fields["supplier_name"]
109121
assert supplier_name is not None
110122
assert supplier_name.value == "John Smith"
123+
assert supplier_name.confidence is None
124+
assert len(supplier_name.locations) == 0
111125

112126

113127
@pytest.mark.integration

0 commit comments

Comments
 (0)