feat: 밤 구간(21~06시) Open-Meteo 햇빛 값(일조·일사·자외선) 저장 제외, 지수 계산은 0으로 처리
This commit is contained in:
1 parent
1a1df4bb87
commit
9dacc86f47
6 files changed
+50
-9
No files matched your search
@@ -134,6 +134,20 @@ def test_windows_attach_instant_values_from_nearest_slot_and_sunshine_from_cover
|
||||
assert all(h.uv is None and h.sunshine_ratio is None for h in no_om)
|
||||
|
||||
|
||||
def test_dark_slots_count_as_no_sun_not_unknown():
|
||||
day = date(2026, 10, 6)
|
||||
start = kst_midnight(day)
|
||||
by_at = {
|
||||
start + timedelta(hours=h): WeatherHourly(
|
||||
forecast_at=start + timedelta(hours=h), feels_c=20, rain_type=1, rain_prob=0, wind_ms=1.0, humidity=50, sky=1
|
||||
)
|
||||
for h in (22, 23)
|
||||
}
|
||||
by_om = {start + timedelta(hours=24): OpenMeteoHourly(forecast_at=start + timedelta(hours=24), uv_index=None, sunshine_s=None, visibility_m=20000)}
|
||||
hours = windows_for(SimpleNamespace(windows=[{"from": 22, "to": 24}]), day, None, by_at, by_om)[0]
|
||||
assert [(h.uv, h.sunshine_ratio, h.visibility_km) for h in hours] == [(0.0, 0.0, 20.0)] * 2
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
async def test_new_axis_shows_only_for_weighted_indices_and_unknown_without_data(fakes):
|
||||
async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as client:
|
||||
|
||||
Reference in new issue
Block a user