"""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 안 하면 통과
