Пример #1
0
    def _regInIoC(self):
        self._ioc.bind(Habitat, self)

        for s, cts in self._servicesToContracts.iteritems():
            [annot] = filter(lambda x: isinstance(x, Service), Annotations.getAnnotations(s))
            scope = annot.scope or NoScope
            scope = scope()

            for c in cts:
                self._ioc.bind(c, s, scope)
Пример #2
0
 def testClassAnnotationsParams(self):
     self.assertEqual(len(Annotations.getAnnotations(Bar)), 1)
     self.assertEqual(Annotations.getAnnotations(Bar)[0].data, "bar")
Пример #3
0
 def testClassAnnotationsList(self):
     self.assertEqual(len(Annotations.getAnnotations(Foo)), 1)