def test_prepare_invalid_access(verify_token, options):
handler = mock_handler(base.AuthHandler)
handler.METHOD_ACCESS = {
"HEAD": "r",
"OPTIONS": "r",
"POST": "w",
"PATCH": "w",
"PUT": "w",
"DELETE": "w"
}
handler.request.method = 'GET'
with pytest.raises(base.HTTPError) as exc:
IOLoop.instance().run_sync(handler.prepare)
assert exc.value.status_code == 500
assert not verify_token.called
评论列表
文章目录