예제 #1
0
 def test_instance_staticmethod_wiring(self):
     instance = module.TestClass()
     service = instance.static_method()
     self.assertIsInstance(service, Service)
예제 #2
0
 def test_class_method_wiring(self):
     test_class_object = module.TestClass()
     service = test_class_object.method()
     self.assertIsInstance(service, Service)
예제 #3
0
 def test_class_wiring(self):
     test_class_object = module.TestClass()
     self.assertIsInstance(test_class_object.service, Service)
예제 #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)
예제 #5
0
 def test_unwire_class_method(self):
     self.container.unwire()
     test_class_object = module.TestClass()
     self.assertIsInstance(test_class_object.method(), Provide)