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)
def testClassAnnotationsParams(self): self.assertEqual(len(Annotations.getAnnotations(Bar)), 1) self.assertEqual(Annotations.getAnnotations(Bar)[0].data, "bar")
def testClassAnnotationsList(self): self.assertEqual(len(Annotations.getAnnotations(Foo)), 1)