Skip to content

Commit 2524f66

Browse files
committed
fix NEXUS-817: fixed contract tests
1 parent 5ddf159 commit 2524f66

File tree

2 files changed

+13
-23
lines changed

2 files changed

+13
-23
lines changed

_test_contract/platform_api/test_workflows.py

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -229,17 +229,12 @@ def test_run_workflow(httpx_mock, platform_client: UnstructuredClient, platform_
229229
url=url,
230230
status_code=202,
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": "SCHEDULED",
235+
"runtime": None,
236+
"workflow_id": "16b80fee-64dc-472d-8f26-1d7729b6423d",
237+
"workflow_name": "test_workflow",
243238
},
244239
)
245240

@@ -257,16 +252,10 @@ def test_run_workflow(httpx_mock, platform_client: UnstructuredClient, platform_
257252
assert request.method == "POST"
258253
assert request.url == url
259254

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"
255+
workflow_run = run_workflow_response.job_information
256+
assert workflow_run.id == "fcdc4994-eea5-425c-91fa-e03f2bd8030d"
257+
assert workflow_run.workflow_name == "test_workflow"
258+
assert workflow_run.status == "SCHEDULED"
265259
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")]
260+
"2025-06-22T11:37:21.648+00:00"
270261
)
271-
assert workflow_run.sources == ["a9593964-92eb-496f-84ac-c8f067ba24c3"]
272-
assert workflow_run.destinations == ["aeebecc7-9d8e-4625-bf1d-815c2f084869"]

_test_contract/test_retries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ def test_list_jobs_retries(httpx_mock, platform_client: UnstructuredClient, plat
1717
httpx_mock.add_response(
1818
method="GET",
1919
headers={"Content-Type": "application/json"},
20+
status_code=200,
2021
json=[
2122
{
2223
"created_at": "2025-06-22T11:37:21.648Z",
2324
"id": "fcdc4994-eea5-425c-91fa-e03f2bd8030d",
24-
"status": "active",
25+
"status": "COMPLETED",
2526
"runtime": None,
2627
"workflow_id": "16b80fee-64dc-472d-8f26-1d7729b6423d",
2728
"workflow_name": "test_workflow",

0 commit comments

Comments
 (0)