Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_user_assign_valid_level():
app = App(__name__)
app.config.logging.pytest = sdict(
level='info'
)
result = _call_create_logger(app)
assert result.handlers[-1].level == logging.INFO
def app():
rv = App(__name__)
rv.config.mailer.sender = 'support@example.com'
return rv
def app():
rv = App(__name__)
rv.config.mailer.sender = 'nina@massivedynamics.com'
rv.config.auth.single_template = True
rv.config.auth.hmac_key = "foobar"
rv.pipeline = [SessionManager.cookies('foobar')]
return rv
def test_user_assign_invaild_level():
app = App(__name__)
app.config.logging.pytest = sdict(
level='invalid'
)
result = _call_create_logger(app)
assert result.handlers[-1].level == logging.WARNING
def test_user_no_assign_level():
app = App(__name__)
app.config.logging.pytest = sdict()
result = _call_create_logger(app)
assert result.handlers[-1].level == logging.WARNING
def db():
app = App(__name__)
db = Database(
app, config=sdict(
uri='sqlite:memory', auto_migrate=True, auto_connect=True))
db.define_models(Register)
return db
def app():
app = App(__name__)
app.languages = ['en', 'it']
app.language_default = 'en'
app.language_force_on_url = True
@app.route()
def test_route():
return 'Test Router'
@app.route()
def test_404():
abort(404, 'Not found, dude')
@app.route('/test2//')
def test_route2(a, b):
return 'Test Router'
def app():
rv = App(__name__)
rv.config.db.uri = 'sqlite:memory'
return rv