test_throttle.py 文件源码

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

项目:websauna 作者: websauna 项目源码 文件源码
def test_throttle(throttle_app: TestApp, test_request):
    """Throttling should give us 429."""

    app = throttle_app

    # clear counter from previous test run
    clear_throttle(test_request, "throttle_sample")

    app.get("/", status=200)

    # We exceeded the limit of 1 request per hour
    app.get("/", status=429)

    # Let's clear the counter
    clear_throttle(test_request, "throttle_sample")

    app.get("/", status=200)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号