2020-09-02 01:39:23 +00:00
|
|
|
"""`Object` provider example."""
|
2016-06-09 14:49:09 +00:00
|
|
|
|
2020-09-03 21:00:14 +00:00
|
|
|
from dependency_injector import containers, providers
|
2016-06-09 14:49:09 +00:00
|
|
|
|
|
|
|
|
2020-09-03 21:00:14 +00:00
|
|
|
class Container(containers.DeclarativeContainer):
|
|
|
|
|
|
|
|
object_provider = providers.Object(1)
|
2016-06-09 14:49:09 +00:00
|
|
|
|
2020-09-02 01:39:23 +00:00
|
|
|
|
2021-09-30 19:32:21 +00:00
|
|
|
if __name__ == "__main__":
|
2020-09-03 21:00:14 +00:00
|
|
|
container = Container()
|
|
|
|
|
|
|
|
assert container.object_provider() == 1
|