예제 #1
0
    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()
예제 #2
0
    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()
예제 #3
0
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()
예제 #4
0
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()