mik-laj edited a comment on pull request #18337:
URL: https://github.com/apache/airflow/pull/18337#issuecomment-922112023


   I was able to fix this test.
   ```diff
   diff --git a/tests/providers/amazon/aws/hooks/test_kinesis.py 
b/tests/providers/amazon/aws/hooks/test_kinesis.py
   index 52984325e..5b9a1675d 100644
   --- a/tests/providers/amazon/aws/hooks/test_kinesis.py
   +++ b/tests/providers/amazon/aws/hooks/test_kinesis.py
   @@ -19,26 +19,36 @@
    import unittest
    import uuid
    
   +import boto3
   +
    from airflow.providers.amazon.aws.hooks.kinesis import AwsFirehoseHook
    
    try:
   -    from moto import mock_kinesis
   +    from moto import mock_firehose
   +except ImportError:
   +    mock_firehose = None
   +try:
   +    from moto import mock_s3
    except ImportError:
   -    mock_kinesis = None
   +    mock_s3 = None
    
    
    class TestAwsFirehoseHook(unittest.TestCase):
   -    @unittest.skipIf(mock_kinesis is None, 'mock_kinesis package not 
present')
   -    @mock_kinesis
   +    @unittest.skipIf(mock_firehose is None, 'mock_firehose package not 
present')
   +    @mock_firehose
        def test_get_conn_returns_a_boto3_connection(self):
            hook = AwsFirehoseHook(
                aws_conn_id='aws_default', delivery_stream="test_airflow", 
region_name="us-east-1"
            )
            assert hook.get_conn() is not None
    
   -    @unittest.skipIf(mock_kinesis is None, 'mock_kinesis package not 
present')
   -    @mock_kinesis
   +    @unittest.skipIf(mock_firehose is None, 'mock_firehose package not 
present')
   +    @unittest.skipIf(mock_s3 is None, 'mock_s3 package not present')
   +    @mock_firehose
   +    @mock_s3
        def test_insert_batch_records_kinesis_firehose(self):
   +        s3_client = boto3.client('s3')
   +        s3_client.create_bucket(Bucket='kinesis-test')
            hook = AwsFirehoseHook(
                aws_conn_id='aws_default', delivery_stream="test_airflow", 
region_name="us-east-1"
            )
   @@ -55,7 +65,7 @@ class TestAwsFirehoseHook(unittest.TestCase):
            )
    
            stream_arn = response['DeliveryStreamARN']
   -        assert stream_arn == 
"arn:aws:firehose:us-east-1:123456789012:deliverystream/test_airflow"
   +        assert stream_arn == 
"arn:aws:firehose:us-east-1:123456789012:/delivery_stream/test_airflow"
    
            records = [{"Data": str(uuid.uuid4())} for _ in range(100)]
    
   
   ```


-- 
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]


Reply via email to