This commit is contained in:
Roman Mogylatov 2020-10-20 13:22:13 -04:00
parent fa81cadf29
commit ee809a44e6
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,8 @@
from dependency_injector.wiring import Provide
from ..container import Container
from ..service import Service
def test_package_function(service: Service = Provide[Container.service]):
return service

View File

@ -21,6 +21,11 @@ class WiringTest(unittest.TestCase):
self.addCleanup(self.container.unwire)
def test_package_lookup(self):
from .package import test_package_function
service = test_package_function()
self.assertIsInstance(service, Service)
def test_package_submodule_lookup(self):
from .package.subpackage.submodule import test_function
service = test_function()
self.assertIsInstance(service, Service)