john-jac commented on code in PR #66544:
URL: https://github.com/apache/airflow/pull/66544#discussion_r3204359251


##########
providers/amazon/tests/unit/amazon/aws/operators/test_s3_tables.py:
##########
@@ -313,3 +314,31 @@ def test_execute(self, mock_conn):
 
     def test_template_fields(self):
         validate_template_fields(self.operator)
+
+
+class TestS3TablesRenameTableOperator:
+    def setup_method(self):
+        self.operator = S3TablesRenameTableOperator(
+            task_id="rename_table",
+            table_bucket_arn=TABLE_BUCKET_ARN,
+            namespace=NAMESPACE,
+            table_name=TABLE_NAME,
+            new_name="new_table",
+        )
+
+    @mock.patch.object(S3TablesHook, "conn", new_callable=mock.PropertyMock)
+    def test_execute(self, mock_conn):
+        mock_client = mock.MagicMock()
+        mock_conn.return_value = mock_client
+
+        self.operator.execute({})
+
+        mock_client.rename_table.assert_called_once_with(
+            tableBucketARN=TABLE_BUCKET_ARN,
+            namespace=NAMESPACE,
+            name=TABLE_NAME,
+            newName="new_table",

Review Comment:
   Added test_execute_with_optional_args that passes new_namespace_name and 
version_token and asserts they're forwarded to the API call.



-- 
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]

Reply via email to