def setUpClass(self): cfg = RZ_Config.init_from_file('res/etc/rhizi-server.conf') self.db_ctl = dbc.DB_Controller(cfg.db_base_url) rz_api.db_ctl = self.db_ctl # TODO extract to superclass log = logging.getLogger('rhizi') log.setLevel(logging.DEBUG) log_handler_c = logging.StreamHandler() log.addHandler(log_handler_c)
def __init__(self, config_dir): cfg = init_config(config_dir) kernel = RZ_Kernel() db_ctl = dbc.DB_Controller(cfg.db_base_url) kernel.db_ctl = db_ctl user_db = Fake_User_DB() webapp = init_webapp(cfg, kernel) webapp.user_db = user_db kernel.db_op_factory = webapp # assist kernel with DB initialization kernel.start() time.sleep(0.1) self.kernel = kernel
def setUpClass(self): cfg = RZ_Config.init_from_file('res/etc/rhizi-server.conf') self.db_ctl = db_controller.DB_Controller(cfg.db_base_url) self.log = logging.getLogger('rhizi') self.log.addHandler(logging.StreamHandler()) # bootstrap kernel kernel = RZ_Kernel() kernel.db_ctl = self.db_ctl kernel.db_op_factory = DBO_factory__default() kernel.start() self.kernel = kernel while not self.kernel.is_DB_status__ok( ): # wait for kernel to initialize... time.sleep(0.3)
def init_test_db_controller(cfg): ret = dbc.DB_Controller(cfg.db_base_url) return ret
def setUpClass(self): cfg = Config.init_from_file('res/etc/rhizi-server.conf') self.db_ctl = dbc.DB_Controller(cfg.db_base_url) self.log = logging.getLogger('rhizi') self.log.addHandler(logging.StreamHandler())