Skip to content

Commit ffd51c8

Browse files
committed
Add supervisor handling test
1 parent b2a9f24 commit ffd51c8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

task-sdk/tests/task_sdk/execution_time/test_supervisor.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
GetTICount,
7575
GetVariable,
7676
GetXCom,
77+
GetXComSequenceItem,
7778
OKResponse,
7879
PrevSuccessfulDagRunResult,
7980
PutVariable,
@@ -1436,6 +1437,36 @@ def watched_subprocess(self, mocker):
14361437
TaskStatesResult(task_states={"run_id": {"task1": "success", "task2": "failed"}}),
14371438
id="get_task_states",
14381439
),
1440+
pytest.param(
1441+
GetXComSequenceItem(
1442+
key="test_key",
1443+
dag_id="test_dag",
1444+
run_id="test_run",
1445+
task_id="test_task",
1446+
offset=0,
1447+
),
1448+
b'{"key":"test_key","value":"test_value","type":"XComResult"}\n',
1449+
"xcoms.get_sequence_item",
1450+
("test_dag", "test_run", "test_task", "test_key", 0),
1451+
{},
1452+
XComResult(key="test_key", value="test_value"),
1453+
id="get_xcom_seq_item",
1454+
),
1455+
pytest.param(
1456+
GetXComSequenceItem(
1457+
key="test_key",
1458+
dag_id="test_dag",
1459+
run_id="test_run",
1460+
task_id="test_task",
1461+
offset=2,
1462+
),
1463+
b'{"error":"XCOM_NOT_FOUND","detail":null,"type":"ErrorResponse"}\n',
1464+
"xcoms.get_sequence_item",
1465+
("test_dag", "test_run", "test_task", "test_key", 2),
1466+
{},
1467+
ErrorResponse(error=ErrorType.XCOM_NOT_FOUND),
1468+
id="get_xcom_seq_item_not_found",
1469+
),
14391470
],
14401471
)
14411472
def test_handle_requests(

0 commit comments

Comments
 (0)