-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_workflow_integration.py
More file actions
39 lines (27 loc) · 1.1 KB
/
test_workflow_integration.py
File metadata and controls
39 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import os
from datetime import datetime
import pytest
from mindee import Client
from mindee.input import WorkflowOptions
from mindee.parsing.common.execution_priority import ExecutionPriority
from tests.product import PRODUCT_DATA_DIR
@pytest.fixture
def mindee_client():
return Client()
@pytest.fixture
def workflow_id():
return os.getenv("WORKFLOW_ID", "")
@pytest.fixture
def input_path():
return PRODUCT_DATA_DIR / "financial_document" / "default_sample.jpg"
@pytest.mark.integration
def test_workflow(mindee_client: Client, workflow_id: str, input_path: str):
input_source = mindee_client.source_from_path(str(input_path))
current_date_time = datetime.now().strftime("%Y-%m-%d-%H:%M:%S")
alias = f"python-{current_date_time}"
priority = ExecutionPriority.LOW
options = WorkflowOptions(alias=alias, priority=priority, rag=True)
response = mindee_client.execute_workflow(input_source, workflow_id, options)
assert response.api_request.status_code == 202
assert response.execution.file.alias == f"python-{current_date_time}"
assert response.execution.priority == "low"