Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/_test-units.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ name: Test
on:
workflow_call:

env:
MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_FINDOC_MODEL_ID }}
MINDEE_V2_SE_TESTS_BLANK_PDF_URL: ${{ secrets.MINDEE_V2_SE_TESTS_BLANK_PDF_URL }}
MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CLASSIFICATION_MODEL_ID }}
MINDEE_V2_SE_TESTS_CROP_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_CROP_MODEL_ID }}
MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_SPLIT_MODEL_ID }}
MINDEE_V2_SE_TESTS_OCR_MODEL_ID: ${{ secrets.MINDEE_V2_SE_TESTS_OCR_MODEL_ID }}

jobs:
pytest:
name: Run Unit Tests
Expand Down
8 changes: 4 additions & 4 deletions tests/v2/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,22 +296,22 @@ def make_request():

@pytest.mark.v2
@respx.mock
def test_explicit_timeout_failure(findoc_model_id) -> None:
def test_explicit_timeout_failure() -> None:
respx.post("https://api-v2.mindee.net/v2/products/extraction/enqueue").mock(
side_effect=httpx.ReadTimeout("Simulated Read Timeout")
)

client = Client(api_key="dummy")
input_source = PathInput(FILE_TYPES_PATH / "pdf" / "blank_1.pdf")
params = ExtractionParameters(model_id=findoc_model_id)
params = ExtractionParameters(model_id="toto")

with pytest.raises(httpx.ReadTimeout):
client.enqueue(input_source, params)


@pytest.mark.v2
@respx.mock
def test_explicit_500_server_error(findoc_model_id: str) -> None:
def test_explicit_500_server_error() -> None:
respx.post(re.compile(r"https://api-v2\.mindee\.net/v2/.+/enqueue")).mock(
return_value=httpx.Response(
500,
Expand All @@ -321,7 +321,7 @@ def test_explicit_500_server_error(findoc_model_id: str) -> None:

client = Client(api_key="dummy")
input_source = PathInput(FILE_TYPES_PATH / "pdf" / "blank_1.pdf")
params = ExtractionParameters(model_id=findoc_model_id)
params = ExtractionParameters(model_id="toto")
with pytest.raises(MindeeHTTPUnknownErrorV2) as exc_info:
client.enqueue(input_source, params)

Expand Down
Loading