xrmr commented on code in PR #32016:
URL: https://github.com/apache/airflow/pull/32016#discussion_r1253438074
##########
tests/providers/snowflake/hooks/test_snowflake.py:
##########
@@ -342,6 +344,24 @@ def
test_get_conn_params_should_support_private_auth_with_unencrypted_key(
), pytest.raises(TypeError, match="Password was given but private key
is not encrypted."):
SnowflakeHook(snowflake_conn_id='test_conn')._get_conn_params()
+ def test_get_conn_params_should_fail_on_invalid_key(self):
+ connection_kwargs = {
+ **BASE_CONNECTION_KWARGS,
+ 'password': None,
+ 'extra': {
+ 'database': 'db',
+ 'account': 'airflow',
+ 'warehouse': 'af_wh',
+ 'region': 'af_region',
+ 'role': 'af_role',
+ 'private_key_file': "/dev/urandom",
+ },
+ }
+ with unittest.mock.patch.dict(
Review Comment:
The `unittest` here is the root cause of the failed checks; delete it to
make the checks pass.
```suggestion
with mock.patch.dict(
```
--
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]