gopidesupavan commented on code in PR #39300:
URL: https://github.com/apache/airflow/pull/39300#discussion_r1582573663
##########
tests/providers/amazon/aws/operators/test_lambda_function.py:
##########
@@ -125,6 +125,38 @@ def test_create_lambda_deferrable(self, _):
with pytest.raises(TaskDeferred):
operator.execute(None)
+ @mock.patch.object(LambdaHook, "create_lambda")
+ @mock.patch.object(LambdaHook, "conn")
+ @pytest.mark.parametrize(
+ "config",
+ [
+ pytest.param({"architectures": ["arm64"],
+ "logging_config": {
+ "LogFormat": "Text",
+ "LogGroup": "/custom/log-group/"
+ }
+ }, id="with-config-argument"),
+ ],
+ )
+ def test_create_lambda_using_config_argument(self,
+ mock_hook_conn,
+ mock_hook_create_lambda,
config):
+ operator = LambdaCreateFunctionOperator(
+ task_id="task_test",
+ function_name=FUNCTION_NAME,
+ role=ROLE_ARN,
+ code={
+ "ImageUri": IMAGE_URI,
+ },
+ config=config
+ )
+ operator.execute(None)
+
+ mock_hook_create_lambda.assert_called_once()
+ mock_hook_conn.get_waiter.assert_not_called()
+ assert operator.config.get("logging_config") ==
config.get("logging_config")
+ assert operator.config.get("architectures") ==
config.get("architectures")
+
Review Comment:
Thank you @amoghrajesh Yes i have updated the TC now.
--
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]