ramitkataria commented on code in PR #72098:
URL: https://github.com/apache/airflow/pull/72098#discussion_r3867811855
##########
providers/amazon/tests/unit/amazon/aws/operators/test_mwaa.py:
##########
@@ -115,3 +119,20 @@ def test_execute_wait_combinations(self, mock_hook, _,
wait_for_completion, defe
assert response == HOOK_RETURN_VALUE
assert mock_hook.get_waiter.call_count == wait_for_completion
assert op.defer.call_count == deferrable
+
+ @mock.patch.object(MwaaTriggerDagRunOperator, "hook")
+ def test_deferred_trigger_receives_hook_configuration(self, mock_hook):
+ mock_hook.invoke_rest_api.return_value = HOOK_RETURN_VALUE
+ op = MwaaTriggerDagRunOperator(
+ **{**OP_KWARGS, "wait_for_completion": False, "deferrable": True},
+ region_name=REGION_NAME,
+ verify=VERIFY,
+ botocore_config=BOTOCORE_CONFIG,
+ )
+
+ with pytest.raises(TaskDeferred) as exc_info:
+ op.execute({})
+
+ assert exc_info.value.trigger.region_name == REGION_NAME
Review Comment:
Let's assert on the serialized attributes (`trigger.serialize()[1]`) like
`test_neptune.py` does, instead of the pre-serialization attributes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]