Files
MoviePilot/tests/test_site_command_routes.py
DDSRem 2de976f6b3 Merge pull request #7050 from DDSRem-Dev/codex-comment-migration
docs: 统一全项目中文注释和结构化契约说明
2026-10-17 19:26:29 +08:00

21 lines
531 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
验证站点交互命令的识别和路由。
"""
from fastapi import FastAPI
from app.api.endpoints import site
def test_site_commands_publish_post_and_hide_legacy_get() -> None:
"""
站点副作用命令只在 OpenAPI 中发布 POST,旧 GET 仅保留运行时兼容。
"""
app = FastAPI()
app.include_router(site.router, prefix="/api/v1/site")
paths = app.openapi()["paths"]
assert set(paths["/api/v1/site/cookiecloud"]) == {"post"}
assert set(paths["/api/v1/site/reset"]) == {"post"}