python-dependency-injector/examples/di_demo/test.py

12 lines
260 B
Python
Raw Normal View History

2020-08-15 18:01:58 +03:00
from unittest import mock
from demo import Container
if __name__ == '__main__':
container = Container()
with container.api_client.override(mock.Mock()):
service = container.service()
assert isinstance(service.api_client, mock.Mock)