Skip to content

Commit b6fb633

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

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
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: 10 additions & 5 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,7 +43,6 @@ 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

@@ -88,13 +87,16 @@ def test_parse_file_empty_single_page_options_must_succeed(
8887
raw_text=True,
8988
polygon=True,
9089
confidence=True,
91-
webhook_ids=[],
9290
alias="py_integration_empty_page_options",
9391
)
9492
response: InferenceResponse = v2_client.enqueue_and_get_inference(
9593
input_source, params
9694
)
9795

96+
assert response.inference.file is not None
97+
assert response.inference.file.name == "blank_1.pdf"
98+
assert response.inference.file.page_count == 1
99+
98100
assert response.inference.active_options is not None
99101
assert response.inference.active_options.rag is True
100102
assert response.inference.active_options.raw_text is True
@@ -110,7 +112,7 @@ def test_parse_file_filled_single_page_must_succeed(
110112
"""
111113
Upload a filled single-page JPEG and verify that common fields are present.
112114
"""
113-
input_path: Path = V1_PRODUCT_DATA_DIR / "financial_document" / "default_sample.jpg"
115+
input_path: Path = V2_PRODUCT_DATA_DIR / "financial_document" / "default_sample.jpg"
114116

115117
input_source = PathInput(input_path)
116118
params = InferenceParameters(
@@ -222,7 +224,7 @@ def test_unknown_webhook_ids_must_throw_error(
222224

223225
@pytest.mark.integration
224226
@pytest.mark.v2
225-
def test_url_input_source_must_not_raise_errors(
227+
def test_blank_url_input_source_must_succeed(
226228
v2_client: ClientV2,
227229
findoc_model_id: str,
228230
) -> None:
@@ -246,3 +248,6 @@ def test_url_input_source_must_not_raise_errors(
246248
)
247249
assert response is not None
248250
assert response.inference is not None
251+
252+
assert response.inference.file is not None
253+
assert response.inference.file.page_count == 1

0 commit comments

Comments
 (0)