mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-05-22 21:46:17 +03:00
Add extra test
This commit is contained in:
parent
f3e8dfaa3d
commit
f56359a554
|
@ -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
|
|
@ -25,6 +25,11 @@ class WiringTest(unittest.TestCase):
|
|||
service = test_package_function()
|
||||
self.assertIsInstance(service, Service)
|
||||
|
||||
def test_package_subpackage_lookup(self):
|
||||
from .package.subpackage 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()
|
||||
|
|
Loading…
Reference in New Issue
Block a user