Example #1
0
    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)
Example #2
0
    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)
Example #3
0
    def test_rzdb__init_DB(self):
        rz_cfg = RZ_Config.generate_default()
        op = DBO_rzdb__init_DB(rz_cfg.rzdoc__mainpage_name)
        try:  # assert first init call passes
            self.db_ctl.exec_op(op)
        except:
            self.fail()

        try:  # assert second init call fails
            self.db_ctl.exec_op(op)
        except:
            return
        self.fail()
Example #4
0
    def test_rzdb__init_DB(self):
        rz_cfg = RZ_Config.generate_default()
        op = DBO_rzdb__init_DB(rz_cfg.rzdoc__mainpage_name)
        try:  # assert first init call passes
            self.db_ctl.exec_op(op)
        except:
            self.fail()

        try:  # assert second init call fails
            self.db_ctl.exec_op(op)
        except:
            return
        self.fail()
Example #5
0
    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)
Example #6
0
    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)
Example #7
0
def init_config(cfg_dir):
    cfg_path = os.path.join(cfg_dir, 'rhizi-server.conf')
    cfg = RZ_Config.init_from_file(cfg_path)
    return cfg
Example #8
0
 def setUpClass(self):
     cfg = RZ_Config.init_from_file('res/etc/rhizi-server.conf')
     self.db_ctl = dbc.DB_Controller(cfg.neo4j_url)
     self.log = logging.getLogger('rhizi')
     self.log.addHandler(logging.StreamHandler())
Example #9
0
 def setUpClass(self):
     cfg = RZ_Config.generate_default()
     webapp = init_webapp(cfg, None)
     webapp.testing = True
     self.webapp = webapp
Example #10
0
 def setUpClass(self):
     cfg = RZ_Config.init_from_file('res/etc/rhizi-server.conf')
     self.log = init_log(cfg)
Example #11
0
 def setUpClass(self):
     cfg = RZ_Config.init_from_file('res/etc/rhizi-server.conf')
     self.log = init_log(cfg)
Example #12
0
def init_config(cfg_dir):
    cfg_path = os.path.join(cfg_dir, 'rhizi-server.conf')
    cfg = RZ_Config.init_from_file(cfg_path)
    return cfg