cjames23 commented on code in PR #32915:
URL: https://github.com/apache/airflow/pull/32915#discussion_r1349740812
##########
tests/providers/amazon/aws/transfers/test_redshift_to_s3.py:
##########
@@ -216,7 +216,60 @@ def test_custom_select_query_unloading(
assert access_key in unload_query
assert secret_key in unload_query
assert_equal_ignore_multiple_spaces(mock_run.call_args.args[0],
unload_query)
+
+ @pytest.mark.parametrize("table_as_file_name, expected_s3_key", [[True,
"key/table_"], [False, "key"]])
+ @mock.patch("airflow.providers.amazon.aws.hooks.s3.S3Hook.get_connection")
+ @mock.patch("airflow.models.connection.Connection")
Review Comment:
Why are you mocking the connection rather than using the
`airflow.utils.db.merge_conn` for your tests? I also think it would be
preferable here given what the changes are that tests should use Moto which
supports redshift rather than mocking in a way that will not confirm that the
redshift engine handles them as expected and does not return any errors.
--
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]