michalslowikowski00 commented on a change in pull request #12505:
URL: https://github.com/apache/airflow/pull/12505#discussion_r528560820



##########
File path: tests/providers/snowflake/transfers/test_s3_to_snowflake.py
##########
@@ -26,6 +26,41 @@
 class TestS3ToSnowflakeTransfer(unittest.TestCase):
     
@mock.patch("airflow.providers.snowflake.hooks.snowflake.SnowflakeHook.run")
     def test_execute(self, mock_run):
+        table = 'table'
+        stage = 'stage'
+        file_format = 'file_format'
+        schema = 'schema'
+
+        S3ToSnowflakeOperator(
+            s3_keys=None,
+            table=table,
+            stage=stage,
+            file_format=file_format,
+            schema=schema,
+            columns_array=None,
+            task_id="task_id",
+            dag=None,
+        ).execute(None)
+
+        base_sql = """
+                FROM @{stage}/
+                
+                file_format={file_format}
+            """.format(
+            stage=stage, file_format=file_format
+        )
+
+        copy_query = """
+                COPY INTO {schema}.{table} {base_sql}
+            """.format(
+            schema=schema, table=table, base_sql=base_sql
+        )
+
+        assert mock_run.call_count == 1

Review comment:
       You can also use `mock_run.assert_called_once()`.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to