def database(): '''Returns a pre-loaded Database instance''' parent = os.path.dirname(__file__) path = os.path.join(parent, '..', 'test_data') prepare_csv_files(path) db = Database() db.load(path) shutil.rmtree(path) return db
def load_data(app): database = Database() database.load(app.config['DATA_PATH']) app.config.update({'DATABASE': database})