You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/05/16 20:38:07 UTC

[GitHub] [airflow] xinbinhuang commented on a change in pull request #8877: Add S3ToRedshift example dag and system test

xinbinhuang commented on a change in pull request #8877:
URL: https://github.com/apache/airflow/pull/8877#discussion_r426189138



##########
File path: tests/providers/amazon/aws/operators/test_s3_to_redshift_system.py
##########
@@ -0,0 +1,62 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+from tempfile import NamedTemporaryFile
+
+import pytest
+
+from airflow.providers.amazon.aws.example_dags.example_s3_to_redshift import (
+    REDSHIFT_SCHEMA, REDSHIFT_TABLE, S3_BUCKET, S3_KEY,
+)
+from tests.test_utils.amazon_system_helpers import (
+    AWS_DAG_FOLDER, AmazonSystemTest, provide_aws_context, provide_aws_s3_bucket, provide_aws_s3_key,
+)
+from tests.test_utils.postgres_system_helpers import provide_postgres_schema, provide_postgres_table
+
+
+@pytest.fixture
+def provide_s3_bucket_with_key():
+    with provide_aws_s3_bucket(name=S3_BUCKET) as s3_bucket:
+        with NamedTemporaryFile() as file:

Review comment:
       ```suggestion
       with provide_aws_s3_bucket(name=S3_BUCKET) as s3_bucket, NamedTemporaryFile() as file:
   ```




----------------------------------------------------------------
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:
users@infra.apache.org