Exemple #1
0
from bountyfunding.core.config import config

config.init(dict(config_file="", db_in_memory=True))
#To enable testing with real database replace with config.init(dict())

from bountyfunding.core.data import create_database

create_database()
    
    arg_parser.add_argument('--debug', 
            action='store_true', default=None,
            help='Enable debug mode (use only for testing)')
    
    arg_parser.add_argument('--db-in-memory', 
            action='store_true', default=None,
            help='Use empty in-memory database')

    arg_parser.add_argument('--threads', 
            action='store', type=int, default=None,
            help='Number of worker threads')

    args = vars(arg_parser.parse_args())
   
    config.init(args)

    action = args['action']

    if action == Action.RUN:
        run()

    elif action == Action.CREATE_DB:
        create_db()
    
    elif action == Action.SHELL:
        shell()

    else: 
        assert False, 'Invalid action: %s' % action 
Exemple #3
0
                            help='Enable debug mode (use only for testing)')

    arg_parser.add_argument('--db-in-memory',
                            action='store_true',
                            default=None,
                            help='Use empty in-memory database')

    arg_parser.add_argument('--threads',
                            action='store',
                            type=int,
                            default=None,
                            help='Number of worker threads')

    args = vars(arg_parser.parse_args())

    config.init(args)

    action = args['action']

    if action == Action.RUN:
        run()

    elif action == Action.CREATE_DB:
        create_db()

    elif action == Action.SHELL:
        shell()

    else:
        assert False, 'Invalid action: %s' % action