SEPURI-SAI-KRISHNA commented on code in PR #74171:
URL: https://github.com/apache/airflow/pull/74171#discussion_r4176062757
##########
providers/amazon/tests/unit/amazon/aws/utils/test_task_log_fetcher.py:
##########
@@ -44,6 +44,21 @@ def set_up_log_fetcher(self, logger_mock):
def setup_method(self):
self.set_up_log_fetcher()
+ def test_hook_is_built_with_the_given_aws_configuration(self):
+ log_fetcher = AwsTaskLogFetcher(
+ log_group="test_log_group",
+ log_stream_name="test_log_stream_name",
+ fetch_interval=timedelta(milliseconds=1),
+ logger=self.logger_mock,
+ region_name="eu-west-3",
+ verify="/path/to/ca-bundle.pem",
+ botocore_config={"read_timeout": 10},
+ )
+
+ assert log_fetcher.hook.region_name == "eu-west-3"
+ assert log_fetcher.hook._verify == "/path/to/ca-bundle.pem"
+ assert log_fetcher.hook._config.read_timeout == 10
Review Comment:
Done, this one mocks the hook as you suggested. It patches `AwsLogsHook` in
the fetcher's own module and asserts the whole call, so it also pins that
`botocore_config` goes through as `config=`, which is the name `AwsGenericHook`
takes.
--
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]