hack-house/.venv/lib/python3.12/site-packages/tests/extensions/openapi/test_deprecated.py
leetcrypt bb1d662ee1 chore: rename project coven → hack-house ⛧
Rebrand the Rust client crate (coven/ → hh/, package+binary "hack-house"),
README, CLI strings, and branch (coven → hack-house). Gitea repo renamed
cmd-chat → hack-house to match. Crypto/server logic unchanged; selftest +
golden-vector test still green, binary is now `hack-house`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 13:29:14 -07:00

40 lines
897 B
Python

from sanic import Request, Sanic
from sanic.response import text
from sanic_ext import openapi
from .utils import get_spec
def test_deprecated(app: Sanic):
@app.route("/test0")
@openapi.deprecated()
async def handler0(request: Request):
return text("ok")
@app.route("/test1")
@openapi.deprecated
async def handler1(request: Request):
return text("ok")
@app.route("/test2")
async def handler2(request: Request):
"""
openapi:
---
summary: This is a summary.
deprecated: true
"""
return text("ok")
@app.route("/test3")
@openapi.definition(deprecated=True)
async def handler3(request: Request):
return text("ok")
spec = get_spec(app)
paths = spec["paths"]
assert len(paths) == 4
for i in range(4):
assert paths[f"/test{i}"]["get"]["deprecated"]