mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-23 01:56:58 +03:00
Add region name for boto3 integration example
This commit is contained in:
parent
5ccee194c7
commit
fad03f2957
|
@ -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
|
||||||
|
|
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user