mik-laj commented on a change in pull request #8503: URL: https://github.com/apache/airflow/pull/8503#discussion_r412524402
########## File path: tests/providers/google/facebook_ads_to_gcs/operators/test_facebook_ads_to_gcs_system.py ########## @@ -0,0 +1,58 @@ +# +# 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. +import json +import os + +import mock +import pytest + +from airflow.models import Connection +from tests.providers.google.cloud.utils.gcp_authenticator import GCP_GCS_KEY +from tests.test_utils.gcp_system_helpers import ( + FACEBOOK_ADS_TO_GCS_DAG_FOLDER, GoogleSystemTest, provide_gcp_context, +) + +CREDENTIALS_DIR = os.environ.get('CREDENTIALS_DIR', '/files/airflow-breeze-config/keys') +FACEBOOK_KEY = 'facebook.json' +FACEBOOK_CREDENTIALS_PATH = os.path.join(CREDENTIALS_DIR, FACEBOOK_KEY) +CONNECTION_TYPE = os.environ.get('CONNECTION_TYPE', 'facebook_social') +FACEBOOK_CONNECTION_ID = os.environ.get('FACEBOOK_CONNECTION_ID', 'facebook_default') + + [email protected]_file(FACEBOOK_KEY) [email protected]_file(GCP_GCS_KEY) [email protected]("google.facebook_ads_to_gcs") [email protected]("google.cloud") +class FacebookAdsToGcsExampleDagsSystemTest(GoogleSystemTest): + def setUp(self): + super().setUp() + with open(FACEBOOK_CREDENTIALS_PATH) as f: Review comment: Can you extract all the code that creates the connection URL into the new method? It should also return empty text when the credentials could not be determined so that this method can be used in the decorator. ---------------------------------------------------------------- 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]
