From 6790710965cf28cf30a8aae019390e5c8f57d134 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=85=E5=BF=B5?= Date: Fri, 4 Sep 2026 18:16:44 +0800 Subject: [PATCH] =?UTF-8?q?test(analytics):=20overview=20channel=20?= =?UTF-8?q?=E9=9D=9E=E6=B3=95=E5=80=BC=20422=20=E6=96=AD=E8=A8=80=E8=A1=A5?= =?UTF-8?q?=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Code --- yunke-server/tests/test_analytics_api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yunke-server/tests/test_analytics_api.py b/yunke-server/tests/test_analytics_api.py index 2e35991..b76fab0 100644 --- a/yunke-server/tests/test_analytics_api.py +++ b/yunke-server/tests/test_analytics_api.py @@ -84,6 +84,11 @@ async def test_overview_endpoint(make_client, monkeypatch): "/api/analytics/overview", params={"channel": "wechat", "scope": "year"} ) assert r2.status_code == 422 + # channel 非法 → 422(同一 Literal 校验路径) + r3 = await client.get( + "/api/analytics/overview", params={"channel": "sms", "scope": "today"} + ) + assert r3.status_code == 422 async def test_overview_unmapped_accounts(make_client, monkeypatch):