fdemiane commented on code in PR #48107:
URL: https://github.com/apache/airflow/pull/48107#discussion_r2014355240


##########
providers/google/tests/unit/google/cloud/transfers/test_sftp_to_gcs.py:
##########
@@ -302,6 +302,35 @@ def 
test_execute_copy_with_wildcard_and_default_destination_path(self, sftp_hook
             ]
         )
 
+    @mock.patch("airflow.providers.google.cloud.transfers.sftp_to_gcs.GCSHook")
+    
@mock.patch("airflow.providers.google.cloud.transfers.sftp_to_gcs.SFTPHook")
+    def test_execute_copy_single_file_with_stream(self, sftp_hook, gcs_hook):
+        task = SFTPToGCSOperator(
+            task_id=TASK_ID,
+            source_path=SOURCE_OBJECT_NO_WILDCARD,
+            destination_bucket=TEST_BUCKET,
+            destination_path=DESTINATION_PATH_FILE,
+            move_object=False,
+            gcp_conn_id=GCP_CONN_ID,
+            sftp_conn_id=SFTP_CONN_ID,
+            impersonation_chain=IMPERSONATION_CHAIN,
+            use_stream=True,
+        )
+        task.execute(None)

Review Comment:
   NIT: while this rule is not followed in this file, as a best practice in 
unit tests is to divide the spacing in a way to delimit the given-when-then 
blocks. One way to do it here is to have one newline after task = 
SFTPToGCSOperator, and another newline after task.execute, and no newlines 
between assertions. 



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