Skip to content

Commit d8c3a10

Browse files
committed
Fix tests for run_workflow schema change
1 parent 4af910e commit d8c3a10

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ DOCKER_IMAGE ?= downloads.unstructured.io/unstructured-io/unstructured-api:lates
1111
.PHONY: install
1212
install:
1313
pip install -U poetry
14-
python scripts/prepare-readme.py
14+
python scripts/prepare_readme.py
1515
poetry install
1616

1717
## install-speakeasy-cli: download the speakeasy cli tool

_test_contract/platform_api/test_workflows.py

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -226,21 +226,17 @@ def test_run_workflow(httpx_mock, client: UnstructuredClient, platform_api_url:
226226

227227
httpx_mock.add_response(
228228
method="POST",
229-
url=url,
230229
status_code=202,
230+
headers={"Content-Type": "application/json"},
231231
json={
232-
"created_at": "2024-08-04T10:06:22.481Z",
233-
"id": "6c4f327c-7ca2-4933-a68d-2ebe9d9f1445",
234-
"name": "test_workflow",
235-
"schedule": {"crontab_entries": [{"cron_expression": "0 0 * * 0"}]},
236-
"sources": ["a9593964-92eb-496f-84ac-c8f067ba24c3"],
237-
"destinations": [
238-
"aeebecc7-9d8e-4625-bf1d-815c2f084869",
239-
],
240-
"workflow_nodes": [],
241-
"status": "active",
242-
"workflow_type": "platinum",
232+
"created_at": "2025-06-22T11:37:21.648Z",
233+
"id": "fcdc4994-eea5-425c-91fa-e03f2bd8030d",
234+
"status": "IN_PROGRESS",
235+
"runtime": None,
236+
"workflow_id": "16b80fee-64dc-472d-8f26-1d7729b6423d",
237+
"workflow_name": "test_workflow",
243238
},
239+
url=url,
244240
)
245241

246242
run_workflow_response = client.workflows.run_workflow(
@@ -257,16 +253,7 @@ def test_run_workflow(httpx_mock, client: UnstructuredClient, platform_api_url:
257253
assert request.method == "POST"
258254
assert request.url == url
259255

260-
workflow_run = run_workflow_response.workflow_information
261-
assert workflow_run.id == "6c4f327c-7ca2-4933-a68d-2ebe9d9f1445"
262-
assert workflow_run.name == "test_workflow"
263-
assert workflow_run.workflow_type == "platinum"
264-
assert workflow_run.status == "active"
265-
assert workflow_run.created_at == datetime.fromisoformat(
266-
"2024-08-04T10:06:22.481+00:00"
267-
)
268-
assert workflow_run.schedule == shared.WorkflowSchedule(
269-
crontab_entries=[shared.crontabentry.CronTabEntry(cron_expression="0 0 * * 0")]
270-
)
271-
assert workflow_run.sources == ["a9593964-92eb-496f-84ac-c8f067ba24c3"]
272-
assert workflow_run.destinations == ["aeebecc7-9d8e-4625-bf1d-815c2f084869"]
256+
new_job = run_workflow_response.job_information
257+
assert new_job.id == "fcdc4994-eea5-425c-91fa-e03f2bd8030d"
258+
assert new_job.workflow_name == "test_workflow"
259+
assert new_job.status == "IN_PROGRESS"

0 commit comments

Comments
 (0)