Skip to content

Commit 2ce094c

Browse files
committed
version is in folder
1 parent 26ca48e commit 2ce094c

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

.github/workflows/_test-integrations.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ jobs:
5353
run: |
5454
pytest --cov mindee -m integration
5555
56-
5756
- name: Notify Slack Action on Failure
5857
uses: ravsamhq/notify-slack-action@2.3.0
5958
if: ${{ always() && github.ref_name == 'main' }}

tests/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
REQUEST_TIMEOUT_ENV_NAME,
88
)
99

10-
ROOT_DATA_DIR = Path("./tests/data/")
10+
ROOT_DATA_DIR = Path(__file__).parent / "data"
1111
V1_DATA_DIR = ROOT_DATA_DIR / "v1"
1212
V2_DATA_DIR = ROOT_DATA_DIR / "v2"
1313
EXTRAS_DIR = V1_DATA_DIR / "extras"
1414
FILE_TYPES_DIR = ROOT_DATA_DIR / "file_types"
1515
V1_PRODUCT_DATA_DIR = V1_DATA_DIR / "products"
16+
V2_PRODUCT_DATA_DIR = V2_DATA_DIR / "products"
1617

1718

1819
def clear_envvars(monkeypatch) -> None:
File renamed without changes.

tests/v2/test_client_v2_integration.py renamed to tests/v2/test_client_integration.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from mindee import ClientV2, InferenceParameters, PathInput, UrlInputSource
77
from mindee.error.mindee_http_error_v2 import MindeeHTTPErrorV2
88
from 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

Comments
 (0)