Add region name for boto3 integration example

This commit is contained in:
Roman Mogylatov 2021-03-07 10:29:06 -05:00
parent 5ccee194c7
commit fad03f2957
2 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,7 @@ container:
aws_access_key_id: container.config.aws_access_key_id aws_access_key_id: container.config.aws_access_key_id
aws_secret_access_key: container.config.aws_secret_access_key aws_secret_access_key: container.config.aws_secret_access_key
aws_session_token: container.config.aws_session_token aws_session_token: container.config.aws_session_token
region_name: container.config.aws_region_name
s3_client: s3_client:
provider: Factory provider: Factory

View File

@ -280,6 +280,14 @@ class TestSchemaBoto3Session(unittest.TestCase):
def test(self): def test(self):
container = containers.DynamicContainer() container = containers.DynamicContainer()
container.from_yaml_schema(f'{_SAMPLES_DIR}/schemasample/container-boto3-session.yml') container.from_yaml_schema(f'{_SAMPLES_DIR}/schemasample/container-boto3-session.yml')
container.config.from_dict(
{
'aws_access_key_id': 'key',
'aws_secret_access_key': 'secret',
'aws_session_token': 'token',
'aws_region_name': 'us-east-1',
},
)
self.assertEqual(container.s3_client().__class__.__name__, 'S3') self.assertEqual(container.s3_client().__class__.__name__, 'S3')
self.assertEqual(container.sqs_client().__class__.__name__, 'SQS') self.assertEqual(container.sqs_client().__class__.__name__, 'SQS')