feat(stock): GET /api/stock/holidays endpoint (SP-10 task-watcher용)

holidays.json(list) 노출. task-watcher가 휴장일 판정에 조회.
인증 불필요. 주말은 task-watcher가 weekday로 별도 판정.
Plan-B-Infra Phase 1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-22 01:40:44 +09:00
parent 6be74737c2
commit 383f48c71e
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
"""GET /api/stock/holidays — task-watcher 휴장일 조회용."""
from fastapi.testclient import TestClient
from app.main import app
client = TestClient(app)
def test_holidays_returns_list():
r = client.get("/api/stock/holidays")
assert r.status_code == 200
data = r.json()
assert "holidays" in data
assert isinstance(data["holidays"], list)
def test_holidays_entries_are_iso_dates():
r = client.get("/api/stock/holidays")
holidays = r.json()["holidays"]
if holidays:
import datetime as dt
for h in holidays[:5]:
dt.date.fromisoformat(h) # raise 안 하면 통과