Ejemplo n.º 1
0
 def test_instance_staticmethod_wiring(self):
     instance = module.TestClass()
     service = instance.static_method()
     self.assertIsInstance(service, Service)
Ejemplo n.º 2
0
 def test_class_method_wiring(self):
     test_class_object = module.TestClass()
     service = test_class_object.method()
     self.assertIsInstance(service, Service)
Ejemplo n.º 3
0
 def test_class_wiring(self):
     test_class_object = module.TestClass()
     self.assertIsInstance(test_class_object.service, Service)
Ejemplo n.º 4
0
    def test_class_wiring_context_arg(self):
        test_service = self.container.service()

        test_class_object = module.TestClass(service=test_service)
        self.assertIs(test_class_object.service, test_service)
Ejemplo n.º 5
0
 def test_unwire_class_method(self):
     self.container.unwire()
     test_class_object = module.TestClass()
     self.assertIsInstance(test_class_object.method(), Provide)