def setUp(self): self.config = { 'MEDIA_DIRS': [], 'VALID_FILE_EXTENSIONS': ('mp3',), } with app.test_request_context(): self.indexer = Indexer(self.config) os.path.isfile = Mock()
def setUp(self): self.config = { 'MEDIA_DIRS': [], 'VALID_FILE_EXTENSIONS': ('mp3', ), } with app.test_request_context(): self.indexer = Indexer(self.config) os.path.isfile = Mock()
def main(): arguments = docopt(__doc__) ctx = app.test_request_context() ctx.push() if arguments['user']: if arguments['create']: create_user(arguments['<email>'], interactive=True) elif arguments['activate']: activate_user(arguments['<email_or_id>']) elif arguments['deactivate']: deactivate_user(arguments['<email_or_id>']) elif arguments['delete']: delete_user(arguments['<email_or_id>']) ctx.pop()
def main(): arguments = docopt(__doc__) ctx = app.test_request_context() ctx.push() if arguments['user']: if arguments['create']: create_user(arguments['<email>'], interactive=True) elif arguments['activate']: activate_user(arguments['<email_or_id>']) elif arguments['deactivate']: deactivate_user(arguments['<email_or_id>']) elif arguments['delete']: delete_user(arguments['<email_or_id>']) elif arguments['db']: if arguments['create']: create_db() if arguments['destroy']: destroy_db() ctx.pop()