mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-23 01:56:58 +03:00
14 lines
457 B
Python
14 lines
457 B
Python
|
"""`Configuration` provider values loading example."""
|
||
|
|
||
|
from dependency_injector import providers
|
||
|
|
||
|
|
||
|
config = providers.Configuration()
|
||
|
|
||
|
config.from_yaml('examples/providers/configuration/config.yml')
|
||
|
|
||
|
assert config() == {'aws': {'access_key_id': 'KEY', 'secret_access_key': 'SECRET'}}
|
||
|
assert config.aws() == {'access_key_id': 'KEY', 'secret_access_key': 'SECRET'}
|
||
|
assert config.aws.access_key_id() == 'KEY'
|
||
|
assert config.aws.secret_access_key() == 'SECRET'
|