Adaverse commented on code in PR #32322:
URL: https://github.com/apache/airflow/pull/32322#discussion_r1250331454


##########
tests/providers/amazon/aws/transfers/test_gcs_to_s3.py:
##########
@@ -128,7 +128,65 @@ def test_execute_without_replace(self, mock_hook):
             assert [] == uploaded_files
             assert sorted(MOCK_FILES) == sorted(hook.list_keys("bucket", 
delimiter="/"))
 
-    # Test3: There are no files in destination bucket
+    # Test3: All the files (within some folders) are already in origin and 
destination without replace
+    @mock.patch("airflow.providers.amazon.aws.transfers.gcs_to_s3.GCSHook")
+    def test_execute_without_replace_with_folder_structure(self, mock_hook):
+        mock_files_gcs = [f"test{idx}/{mock_file}" for idx, mock_file in 
enumerate(MOCK_FILES)]
+        mock_files_s3 = [f"test/test{idx}/{mock_file}" for idx, mock_file in 
enumerate(MOCK_FILES)]
+        mock_hook.return_value.list.return_value = mock_files_gcs
+
+        hook, bucket = _create_test_bucket()
+        for mock_file_s3 in mock_files_s3:
+            bucket.put_object(Key=mock_file_s3, Body=b"testing")
+
+        with NamedTemporaryFile() as f:
+            gcs_provide_file = mock_hook.return_value.provide_file
+            gcs_provide_file.return_value.__enter__.return_value.name = f.name
+
+            with pytest.deprecated_call():

Review Comment:
   Added specific deprecation it's should be looking for.



##########
tests/providers/amazon/aws/transfers/test_gcs_to_s3.py:
##########
@@ -128,7 +128,65 @@ def test_execute_without_replace(self, mock_hook):
             assert [] == uploaded_files
             assert sorted(MOCK_FILES) == sorted(hook.list_keys("bucket", 
delimiter="/"))
 
-    # Test3: There are no files in destination bucket
+    # Test3: All the files (within some folders) are already in origin and 
destination without replace
+    @mock.patch("airflow.providers.amazon.aws.transfers.gcs_to_s3.GCSHook")
+    def test_execute_without_replace_with_folder_structure(self, mock_hook):
+        mock_files_gcs = [f"test{idx}/{mock_file}" for idx, mock_file in 
enumerate(MOCK_FILES)]
+        mock_files_s3 = [f"test/test{idx}/{mock_file}" for idx, mock_file in 
enumerate(MOCK_FILES)]
+        mock_hook.return_value.list.return_value = mock_files_gcs
+
+        hook, bucket = _create_test_bucket()
+        for mock_file_s3 in mock_files_s3:
+            bucket.put_object(Key=mock_file_s3, Body=b"testing")
+
+        with NamedTemporaryFile() as f:
+            gcs_provide_file = mock_hook.return_value.provide_file
+            gcs_provide_file.return_value.__enter__.return_value.name = f.name
+
+            with pytest.deprecated_call():

Review Comment:
   Added specific deprecation it should be looking for.



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