예제 #1
0
    def test_fork(self):
        e = Entity('test-object', self.plainLoader)

        a = e.fork()
        b = e.fork()

        self.assertTrue(a is not None)
        self.assertTrue(b is not None)
        self.assertNotEquals(a, b);
        self.assertFalse(e.activated)
예제 #2
0
    def __register_normal_entity(self, node):
        entity_id = node.attribute('id')
        kind      = node.attribute('class')
        params    = self.__get_params(node)
        tags      = self.__get_tags(node)

        loader = Loader(kind)
        entity = Entity(entity_id, loader, *params.largs, **params.kwargs)

        entity.interceptable = self.__transformer.cast(node.attribute('interceptable') or 'true', 'bool')
        entity.tags          = tags

        self.locator.set(entity_id, entity)