Ejemplo n.º 1
0
    def setUp(self):
        ioc.teardown()
        self.constant = ioc.constant('test.constant')
        self.function = ioc.function(
            'test.function', args=self.function_args,
            kwargs=self.function_kwargs,
            mode=ioc.KW_OVERRIDE
        )
        self.str_dep = ioc.constant('test.str')

        ioc.provide('test.constant', self.constant_val)
        ioc.provide('test.str', self.str_val)
        ioc.provide('test.function', self.dep_function)

        ioc.load_container(DEPS_FILE)
        ioc.setup(ignore_missing=True)
Ejemplo n.º 2
0
 def test_missing_typeerror(self):
     f = ioc.function(__name__)
     ioc.provide(__name__, int)
     ioc.setup(ignore_missing=True)
     self.assertRaises(TypeError, f, 1, 2, 3, 4)