def test_foundation_initializer_ok(self): db = DatabaseService() it = Initializer(db) p = path_join(self.base_path, "config/initial_directory.xml") entities = it.load(p) self.assertEquals(len(entities), 6, "6 entities added") for entity in entities: self.assertTrue( entity.id is not None, "Entity %s of class %s should be registered" % (entity.alias, entity.__class__) )
''' Server bootstrap ''' from tori.application import Application from tori.centre import services import bootstrap from pints.foundation.initializer import Initializer application = Application('config/server.xml') if not bootstrap.is_production: initializer = Initializer(services.get('db')) initializer.load('%s/config/initial_directory.xml' % bootstrap.app_path) application.start()