Beispiel #1
0
def app():
    conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                        '../configs/test2.cfg')
    _, logfile = tempfile.mkstemp()
    bui = create_app(conf, 1, logfile, gunicorn=False, unittest=True)
    bui.config['DEBUG'] = False
    return bui
Beispiel #2
0
def app():
    conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../configs/test6.cfg')
    bui = create_app(conf, False, '/dev/null', gunicorn=False, unittest=True)
    bui.config['TESTING'] = True
    bui.config['LIVESERVER_PORT'] = 5001
    bui.config['WTF_CSRF_ENABLED'] = False
    bui.client.port = 9999
    return bui
Beispiel #3
0
def app():
    conf = os.path.join(
        os.path.dirname(os.path.realpath(__file__)), "../configs/test6.cfg"
    )
    bui = create_app(conf, False, "/dev/null", gunicorn=False, unittest=True)
    bui.config["TESTING"] = True
    bui.config["LIVESERVER_PORT"] = 5001
    bui.config["WTF_CSRF_ENABLED"] = False
    bui.client.port = 9999
    return bui
Beispiel #4
0
def app():
    conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                        "../configs/test2.cfg")
    bui = create_app(logfile="/dev/null", gunicorn=False, unittest=True)
    bui.setup(conf, True)
    bui.config["TESTING"] = True
    bui.config["LOGIN_DISABLED"] = True
    bui.config["CFG"] = conf
    bui.config["SECRET_KEY"] = "nyan"
    bui.login_manager.init_app(bui)
    return bui
Beispiel #5
0
def app():
    conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                        '../configs/test2.cfg')
    bui = create_app(logfile='/dev/null', gunicorn=False, unittest=True)
    bui.setup(conf, True)
    bui.config['TESTING'] = True
    bui.config['LOGIN_DISABLED'] = True
    bui.config['CFG'] = conf
    bui.config['SECRET_KEY'] = 'nyan'
    bui.login_manager.init_app(bui)
    return bui
Beispiel #6
0
def app(mocker):
    mocker.patch('socket.socket')
    conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                        '../configs/test4.cfg')
    bui = create_app(conf, logfile='/dev/null', gunicorn=False, unittest=True)
    bui.setup(conf, True)
    bui.config['TESTING'] = True
    bui.config['LIVESERVER_PORT'] = 5001
    bui.config['SECRET_KEY'] = 'toto'
    bui.config['WTF_CSRF_ENABLED'] = False
    bui.login_manager.init_app(bui)
    return bui
Beispiel #7
0
def app(mocker):
    mocker.patch("socket.socket")
    conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                        "../configs/test4.cfg")
    bui = create_app(conf, logfile="/dev/null", gunicorn=False, unittest=True)
    bui.setup(conf, True)
    bui.config["TESTING"] = True
    bui.config["LIVESERVER_PORT"] = 5001
    bui.config["SECRET_KEY"] = "toto"
    bui.config["WTF_CSRF_ENABLED"] = False
    bui.login_manager.init_app(bui)
    return bui
Beispiel #8
0
def app(mocker):
    mocker.patch('redis.StrictRedis', mockredis.mock_strict_redis_client)
    mocker.patch('redis.Redis', mock_redis_client)
    conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                        '../configs/test8.cfg')
    bui = create_app(conf, False, '/dev/null', gunicorn=False, unittest=True)
    bui.config['TESTING'] = True
    bui.config['LIVESERVER_PORT'] = 5001
    bui.config['WTF_CSRF_ENABLED'] = False
    bui.config['LOGIN_DISABLED'] = False
    bui.client.port = 9999
    with bui.app_context():
        from burpui.app import create_db
        from burpui.ext.sql import db
        from burpui.models import Session, Task  # noqa
        bui.config['WITH_SQL'] = True
        create_db(bui, True)
        db.create_all()
        db.session.commit()
    yield bui
    if os.path.exists('this-file-should-not-exist'):
        os.rmdir('this-file-should-not-exist')