Ejemplo n.º 1
0
 def setUp(self) -> None:
     self.container = Container(config={'a': {'b': {'c': 10}}})
     self.container.wire(
         modules=[module],
         packages=[package],
     )
     self.addCleanup(self.container.unwire)
Ejemplo n.º 2
0
    def test_bypass_marker_injection(self):
        container = Container()
        container.wire(modules=[module])
        self.addCleanup(container.unwire)

        service = module.test_function(service=Provide[Container.service])
        self.assertIsInstance(service, Service)
Ejemplo n.º 3
0
    def test_wire_queue(self) -> None:
        from wiringsamples import queuemodule
        container = Container()
        self.addCleanup(container.unwire)

        # Should not raise exception
        # See: https://github.com/ets-labs/python-dependency-injector/issues/362
        try:
            container.wire(modules=[queuemodule])
        except:
            raise
Ejemplo n.º 4
0
 def setUp(self) -> None:
     self.container = Container(config={'a': {'b': {'c': 10}}})
     importlib.reload(module)