Exemple #1
0
def clean_db():
    with session_scope() as dao_sess:
        stat_call_on_queue_dao.clean_table(dao_sess)
        stat_agent_periodic_dao.clean_table(dao_sess)
        stat_queue_periodic_dao.clean_table(dao_sess)
        stat_agent_dao.clean_table(dao_sess)
        stat_queue_dao.clean_table(dao_sess)
Exemple #2
0
def clean_db():
    stat_call_on_queue_dao.clean_table(dao_sess)
    stat_agent_periodic_dao.clean_table(dao_sess)
    stat_queue_periodic_dao.clean_table(dao_sess)
    stat_agent_dao.clean_table(dao_sess)
    stat_queue_dao.clean_table(dao_sess)
    def test_clean_table(self):
        self._insert_agent('Agent/123')

        stat_agent_dao.clean_table(self.session)

        self.assertTrue(self.session.query(StatAgent).first() is None)