hack-house/.venv/lib/python3.12/site-packages/tests/extensions/openapi/test_paths.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

59 lines
1.1 KiB
Python

import pytest
from sanic import Sanic
from .utils import get_spec
@pytest.fixture(autouse=True)
def handlers(app: Sanic):
@app.route("/test1")
async def handler1(_): ...
@app.route("/test2/1")
async def handler2(_): ...
@app.route("/test3/")
async def handler3(_): ...
@app.route("/test4/2/")
async def handler4(_): ...
def test_paths_with_all_uri_filter(app: Sanic):
app.config.API_URI_FILTER = "all"
spec = get_spec(app)
assert list(spec["paths"].keys()) == [
"/test1",
"/test1/",
"/test2/1",
"/test2/1/",
"/test3",
"/test3/",
"/test4/2",
"/test4/2/",
]
def test_paths_with_slash_uri_filter(app: Sanic):
app.config.API_URI_FILTER = "slash"
spec = get_spec(app)
assert list(spec["paths"].keys()) == [
"/test1/",
"/test2/1/",
"/test3/",
"/test4/2/",
]
def test_paths_without_uri_filter(app: Sanic):
spec = get_spec(app)
assert list(spec["paths"].keys()) == [
"/test1",
"/test2/1",
"/test3",
"/test4/2",
]