티스토리 뷰

공부

[airflow] awsHook

승가비 2023. 8. 5. 22:17
728x90

https://programtalk.com/python-examples/airflow.contrib.hooks.aws_hook.AwsHook/

 @unittest.skipIf(mock_emr is None, 'mock_emr package not present')
    @mock_emr
    def test_get_client_type_returns_a_boto3_client_of_the_requested_type(self):
        client = boto3.client('emr', region_name='us-east-1')
        if len(client.list_clusters()['Clusters']):
            raise ValueError('AWS not properly mocked')

        hook = AwsHook(aws_conn_id='aws_default')
        client_from_hook = hook.get_client_type('emr')

        self.assertEqual(client_from_hook.list_clusters()['Clusters'], [])

 

728x90

'공부' 카테고리의 다른 글

[datadog] RDS  (0) 2023.08.05
[Coding Standard]  (0) 2023.08.05
[bitbucket] get repository UUID  (0) 2023.08.05
[sh] stdout & stderr > err.log  (0) 2023.08.05
원피스 1화~1084화 100분 만에 다보기 [26년 분량 요약]  (0) 2023.07.30
댓글