def tearDown(self): b_api.fetch(self._get_backend()).clear_all() super(SqlPersistenceTest, self).tearDown() if self.db_location and os.path.isfile(self.db_location): os.unlink(self.db_location) self.db_location = None
def _get_backend(self): if not self.backend: return None return b_api.fetch(self.backend)
def tearDown(self): b_api.fetch(self._get_backend()).clear_all() super(MemoryPersistenceTest, self).tearDown()
def load(lb_id, backend='memory'): """Loads a given logbook (if it exists) from the given backend type.""" return b_api.fetch(backend).logbook_get(lb_id)