You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bb...@apache.org on 2022/04/20 19:00:46 UTC

[airflow] 04/19: add tests

This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch mapped-instance-actions
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit bcf186d9ebd5202b0d26aec244241da9d6482622
Author: Ephraim Anierobi <sp...@gmail.com>
AuthorDate: Tue Apr 12 20:27:39 2022 +0100

    add tests
---
 tests/api/common/test_mark_tasks.py | 6 +++---
 tests/models/test_dag.py            | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/api/common/test_mark_tasks.py b/tests/api/common/test_mark_tasks.py
index 4c1d3c604b..dedb624b1f 100644
--- a/tests/api/common/test_mark_tasks.py
+++ b/tests/api/common/test_mark_tasks.py
@@ -439,12 +439,12 @@ class TestMarkTasks:
     def test_mark_mapped_task_instance_state(self):
         # set mapped task instance to success
         snapshot = TestMarkTasks.snapshot_state(self.dag4, self.execution_dates)
-        task = self.dag4.get_task("consumer_literal")
-        tasks = [(task, 0), (task, 1)]
+        tasks = [self.dag4.get_task("consumer_literal")]
         map_indexes = [0, 1]
         dr = DagRun.find(dag_id=self.dag4.dag_id, execution_date=self.execution_dates[0])[0]
         altered = set_state(
             tasks=tasks,
+            map_indexes=map_indexes,
             run_id=dr.run_id,
             upstream=False,
             downstream=False,
@@ -456,7 +456,7 @@ class TestMarkTasks:
         assert len(altered) == 2
         self.verify_state(
             self.dag4,
-            [task.task_id for task, _ in tasks],
+            [task.task_id for task in tasks],
             [self.execution_dates[0]],
             State.SUCCESS,
             snapshot,
diff --git a/tests/models/test_dag.py b/tests/models/test_dag.py
index 6cd8ea660f..41219ef87b 100644
--- a/tests/models/test_dag.py
+++ b/tests/models/test_dag.py
@@ -1456,7 +1456,7 @@ class TestDag(unittest.TestCase):
         session.flush()
 
         dag.clear(
-            task_ids=[(task_id, 0)],
+            map_indexes=[0],
             start_date=DEFAULT_DATE,
             end_date=DEFAULT_DATE + datetime.timedelta(days=1),
             dag_run_state=dag_run_state,