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)
def test_clean_table(self): self._insert_queue('queue1') stat_queue_dao.clean_table(self.session) self.assertTrue(self.session.query(StatQueue).first() is None)
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)