Пример #1
0
 def create_app(self):
     conf1 = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test7-1.cfg')
     conf2 = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test7-2.cfg')
     BUIinit(conf1, False, None, False, unittest=True)
     BUIinit(conf2, False, None, False, unittest=True)
     bui = BUIinit(None, False, None, False, unittest=True)
     bui.config['TESTING'] = True
     bui.config['LIVESERVER_PORT'] = 5001
     bui.config['WTF_CSRF_ENABLED'] = False
     bui.cli.port = 9999
     return bui
Пример #2
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'configs/test2.cfg')
     _, self.logfile = tempfile.mkstemp()
     bui = BUIinit(conf, 1, self.logfile, gunicorn=False, unittest=True)
     bui.config['DEBUG'] = False
     return bui
Пример #3
0
 def create_app(self):
     kwargs = {'verbose': 0, 'logfile': '/dev/null', 'gunicorn': False, 'unittest': True}
     root = os.path.dirname(os.path.realpath(__file__))
     conf1 = os.path.join(root, 'test7-1.cfg')
     conf2 = os.path.join(root, 'test7-2.cfg')
     conf4 = os.path.join(root, 'test7-4.cfg')
     conf5 = os.path.join(root, 'test7-5.cfg')
     BUIinit(conf1, **kwargs)
     BUIinit(conf2, **kwargs)
     BUIinit(conf4, **kwargs)
     BUIinit(conf5, **kwargs)
     bui = BUIinit(None, **kwargs)
     bui.config['TESTING'] = True
     bui.config['LIVESERVER_PORT'] = 5001
     bui.config['WTF_CSRF_ENABLED'] = False
     bui.client.port = 9999
     return bui
Пример #4
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../share/burpui/etc/burpui.sample.cfg')
     bui = BUIinit(conf, False, None, False, unittest=True)
     bui.config['TESTING'] = True
     bui.config['LIVESERVER_PORT'] = 5001
     bui.config['WTF_CSRF_ENABLED'] = False
     bui.cli.port = 9999
     return bui
Пример #5
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test6.cfg')
     bui = BUIinit(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
Пример #6
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test2.cfg')
     bui = BUIinit(gunicorn=False, unittest=True)
     bui.setup(conf)
     bui.config['TESTING'] = True
     bui.config['LOGIN_DISABLED'] = True
     bui.config['CFG'] = conf
     bui.login_manager.init_app(bui)
     self.bui = bui
     return bui
Пример #7
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test4.cfg')
     bui = BUIinit(conf, gunicorn=False, unittest=True)
     bui.setup(conf)
     bui.config['TESTING'] = True
     bui.config['LOGIN_DISABLED'] = True
     bui.config['LIVESERVER_PORT'] = 5001
     bui.config['SECRET_KEY'] = 'toto'
     bui.login_manager.init_app(bui)
     return bui
Пример #8
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../share/burpui/etc/burpui.sample.cfg')
     bui = BUIinit(debug=12, gunicorn=False, unittest=True)
     bui.setup(conf)
     bui.config['DEBUG'] = False
     bui.config['TESTING'] = True
     bui.config['LOGIN_DISABLED'] = True
     bui.config['LIVESERVER_PORT'] = 5001
     bui.config['CFG'] = conf
     bui.login_manager.init_app(bui)
     return bui
Пример #9
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                         'configs/test2.cfg')
     bui = BUIinit(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)
     self.bui = bui
     return bui
Пример #10
0
def app():
    conf = os.path.join(PWD, 'configs/test_api_prefs.cfg')
    bui = BUIinit(conf, logfile='/dev/null', gunicorn=False, unittest=True)
    bui.config['TESTING'] = True
    bui.config['SECRET_KEY'] = 'nyan'
    bui.config['WTF_CSRF_ENABLED'] = False
    with bui.app_context():
        from burpui.ext.sql import db
        from burpui.models import lazy_loading
        lazy_loading()
        db.create_all()
        db.session.commit()
    yield bui
Пример #11
0
def app():
    conf = os.path.join(PWD, "configs/test_api_prefs.cfg")
    bui = BUIinit(conf, logfile="/dev/null", gunicorn=False, unittest=True)
    bui.config["TESTING"] = True
    bui.config["SECRET_KEY"] = "nyan"
    bui.config["WTF_CSRF_ENABLED"] = False
    with bui.app_context():
        from burpui.ext.sql import db
        from burpui.models import lazy_loading

        lazy_loading()
        db.create_all()
        db.session.commit()
    yield bui
Пример #12
0
 def create_app(self):
     conf = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test8.cfg')
     bui = BUIinit(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
         bui.config['WITH_SQL'] = True
         create_db(bui, True)
         db.create_all()
         db.session.commit()
     return bui