fmaritato commented on a change in pull request #4875: [AIRFLOW-4031] Allow for
key pair auth in snowflake hook
URL: https://github.com/apache/airflow/pull/4875#discussion_r263819390
##########
File path: tests/contrib/hooks/test_snowflake_hook.py
##########
@@ -71,3 +108,30 @@ def test_get_conn_params(self):
def test_get_conn(self):
self.assertEqual(self.db_hook.get_conn(), self.conn)
+
+ def test_key_pair_auth_encrypted(self):
+ self.conn.extra_dejson = {'database': 'db',
+ 'account': 'airflow',
+ 'warehouse': 'af_wh',
+ 'region': 'af_region',
+ 'role': 'af_role',
+ 'private_key_file': '/tmp/test_key.p8'}
+
+ params = self.db_hook._get_conn_params()
+ self.assertTrue('private_key' in params)
+
+ def test_key_pair_auth_not_encrypted(self):
+ self.conn.extra_dejson = {'database': 'db',
+ 'account': 'airflow',
+ 'warehouse': 'af_wh',
+ 'region': 'af_region',
+ 'role': 'af_role',
+ 'private_key_file': '/tmp/test_key.pem'}
Review comment:
Fixed.
----------------------------------------------------------------
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]
With regards,
Apache Git Services