python-dependency-injector/tests/unit/wiring/container.py
Roman Mogylatov 6182b8448a
Wiring refactoring (#296)
* Refactor wiring

* Add todos to wiring

* Implement wiring of config invariant

* Implement sub containers wiring + add tests

* Add test for wiring config invariant
2020-09-27 23:10:11 -04:00

18 lines
356 B
Python

from dependency_injector import containers, providers
from .service import Service
class SubContainer(containers.DeclarativeContainer):
int_object = providers.Object(1)
class Container(containers.DeclarativeContainer):
config = providers.Configuration()
service = providers.Factory(Service)
sub = providers.Container(SubContainer)