test_app_cache.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:veripress 作者: veripress 项目源码 文件源码
def test_app():
    # app's config should be loaded from instance/config.py
    assert app.config['STORAGE_TYPE'] == 'file'
    assert app.config['THEME'] == 'test'

    with app.test_request_context('/'):
        app.send_static_file('no-use.css')
        app.send_static_file('no-use-2.css')
        with raises(NotFound):
            app.send_static_file('non-exists.css')

    origin_mode = app.config['MODE']
    app.config['MODE'] = 'api-only'
    with app.test_request_context('/'):
        with raises(NotFound):
            app.send_static_file('no-use.css')
    app.config['MODE'] = origin_mode
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号