Ejemplo n.º 1
0
Archivo: common.py Proyecto: f3at/feat
    def run_and_configure_db(self):
        yield self.db_process.restart()
        c = self.db_process.get_config()
        db_host, db_port, db_name = c['host'], c['port'], 'test'
        db = database.Database(db_host, db_port, db_name)
        self.addCleanup(db.disconnect)
        self.db = db.get_connection()
        yield tools.create_db(self.db)

        yield tools.push_initial_data(self.db)
        defer.returnValue((db_host, db_port, db_name, ))
Ejemplo n.º 2
0
 def run_and_configure_db(self):
     yield self.db_process.restart()
     c = self.db_process.get_config()
     db_host, db_port, db_name = c['host'], c['port'], 'test'
     db = database.Database(db_host, db_port, db_name)
     self.db = db.get_connection()
     yield tools.create_db(self.db)
     # disable nagios integration for the purpose of this test
     from feat.agents.alert import alert_agent
     alert_config = alert_agent.AlertAgentConfiguration(enabled=False)
     feat.initial_data(alert_config)
     yield tools.push_initial_data(self.db)
     defer.returnValue((db_host, db_port, db_name, ))