@@ -265,6 +265,7 @@ def test_template_fields_overrides(self):
265
265
],
266
266
],
267
267
)
268
+ @mock .patch .object (EcsRunTaskOperator , "xcom_push" )
268
269
@mock .patch .object (EcsRunTaskOperator , "_wait_for_task_ended" )
269
270
@mock .patch .object (EcsRunTaskOperator , "_check_success_task" )
270
271
@mock .patch .object (EcsBaseOperator , "client" )
@@ -273,6 +274,7 @@ def test_execute_without_failures(
273
274
client_mock ,
274
275
check_mock ,
275
276
wait_mock ,
277
+ xcom_mock ,
276
278
launch_type ,
277
279
capacity_provider_strategy ,
278
280
platform_version ,
@@ -626,28 +628,31 @@ def test_reattach_save_task_arn_xcom(
626
628
assert self .ecs .arn == f"arn:aws:ecs:us-east-1:012345678910:task/{ TASK_ID } "
627
629
assert "No active previously launched task found to reattach" in caplog .messages
628
630
631
+ @mock .patch .object (EcsRunTaskOperator , "xcom_push" )
629
632
@mock .patch .object (EcsBaseOperator , "client" )
630
633
@mock .patch ("airflow.providers.amazon.aws.utils.task_log_fetcher.AwsTaskLogFetcher" )
631
- def test_execute_xcom_with_log (self , log_fetcher_mock , client_mock ):
634
+ def test_execute_xcom_with_log (self , log_fetcher_mock , client_mock , xcom_mock ):
632
635
self .ecs .do_xcom_push = True
633
636
self .ecs .task_log_fetcher = log_fetcher_mock
634
637
635
638
log_fetcher_mock .get_last_log_message .return_value = "Log output"
636
639
637
640
assert self .ecs .execute (None ) == "Log output"
638
641
642
+ @mock .patch .object (EcsRunTaskOperator , "xcom_push" )
639
643
@mock .patch .object (EcsBaseOperator , "client" )
640
644
@mock .patch ("airflow.providers.amazon.aws.utils.task_log_fetcher.AwsTaskLogFetcher" )
641
- def test_execute_xcom_with_no_log (self , log_fetcher_mock , client_mock ):
645
+ def test_execute_xcom_with_no_log (self , log_fetcher_mock , client_mock , xcom_mock ):
642
646
self .ecs .do_xcom_push = True
643
647
self .ecs .task_log_fetcher = log_fetcher_mock
644
648
645
649
log_fetcher_mock .get_last_log_message .return_value = None
646
650
647
651
assert self .ecs .execute (None ) is None
648
652
653
+ @mock .patch .object (EcsRunTaskOperator , "xcom_push" )
649
654
@mock .patch .object (EcsBaseOperator , "client" )
650
- def test_execute_xcom_with_no_log_fetcher (self , client_mock ):
655
+ def test_execute_xcom_with_no_log_fetcher (self , client_mock , xcom_mock ):
651
656
self .ecs .do_xcom_push = True
652
657
assert self .ecs .execute (None ) is None
653
658
@@ -657,8 +662,9 @@ def test_execute_xcom_disabled(self, log_fetcher_mock, client_mock):
657
662
self .ecs .do_xcom_push = False
658
663
assert self .ecs .execute (None ) is None
659
664
665
+ @mock .patch .object (EcsRunTaskOperator , "xcom_push" )
660
666
@mock .patch .object (EcsRunTaskOperator , "client" )
661
- def test_with_defer (self , client_mock ):
667
+ def test_with_defer (self , client_mock , xcom_mock ):
662
668
self .ecs .deferrable = True
663
669
664
670
client_mock .run_task .return_value = RESPONSE_WITHOUT_FAILURES
0 commit comments