Esempio n. 1
0
def initdb(ctx):
    """Initialize database, dropping all tables"""
    global STORAGE
    app = ctx.obj
    if STORAGE:
        ctx.fail("Database already initialized.")

    db.create_all()

    if not app.config.get('USE_SQLITE'):
        from alembic import command
        command.stamp(ALEMBIC_CONFIG, 'head')

    STORAGE = Storage.new_storage()
 def setUp(self):
     db.create_all()
     self.path, self.cleanup = create_tempdir()
     self.storage = Storage.new_storage()
 def setUp(self):
     # XXX: Would be nice to scan and read only once
     storage = self.storage = Storage.new_storage()
     storage.scan(BAG_DIR)
     storage.read_pending()