yamakazushi commented on code in PR #72622:
URL: https://github.com/apache/airflow/pull/72622#discussion_r3988262839
##########
providers/amazon/tests/unit/amazon/aws/operators/test_mwaa_serverless.py:
##########
@@ -156,6 +157,47 @@ def test_execute_fail_on_conflict(self, mock_conn):
with pytest.raises(ClientError, match="ConflictException"):
op.execute({})
+ @mock.patch.object(AwsBaseHook, "conn", new_callable=mock.PropertyMock)
+ def test_execute_with_code(self, mock_conn):
+ op = MwaaServerlessCreateWorkflowOperator(
+ task_id="create_workflow",
+ workflow_name=WORKFLOW_NAME,
+ definition_s3_location=S3_LOCATION,
+ code=CODE,
+ role_arn=ROLE_ARN,
+ )
+ mock_client = mock.MagicMock()
+ mock_client.create_workflow.return_value = {"WorkflowArn":
WORKFLOW_ARN}
+ mock_conn.return_value = mock_client
+
+ result = op.execute({})
+
+ mock_client.create_workflow.assert_called_once_with(
+ Name=WORKFLOW_NAME, DefinitionS3Location=S3_LOCATION, Code=CODE,
RoleArn=ROLE_ARN
+ )
+ assert result == WORKFLOW_ARN
+
+ @mock.patch.object(AwsBaseHook, "conn", new_callable=mock.PropertyMock)
+ def test_execute_with_code_version_id(self, mock_conn):
Review Comment:
I deleted former and left latter test.
--
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]