fix(core): clean predictor debt

This commit is contained in:
dasemu committed 2026-03-13 10:51:29 +01:00
1 parent e952cea417
commit e6add1b727
10 files changed
+268 -58

No files matched your search

+21
View File
@@ -5,8 +5,11 @@ from __future__ import annotations
import sys
import types
from datetime import datetime
from pathlib import Path
from zoneinfo import ZoneInfo
import yaml
telegram_module = types.ModuleType("telegram")
@@ -186,3 +189,21 @@ def test_format_daily_predictions_includes_all_three_stations():
assert "San Isidro" in text
assert "Fuentes de Invierno" in text
assert "2026-03-14" in text
def test_station_metadata_is_loaded_from_shared_config():
"""Bot station labels and max km must come from config/stations.yaml."""
config_path = Path(__file__).resolve().parents[1] / "config" / "stations.yaml"
with config_path.open("r", encoding="utf-8") as fh:
stations = yaml.safe_load(fh)["stations"]
expected = {
station_id: {
"name": station_cfg["name"],
"max_km": float(station_cfg["max_km_skiable"]),
}
for station_id, station_cfg in stations.items()
}
assert telegram_bot.STATIONS == expected
assert telegram_bot.STATION_ORDER == tuple(stations.keys())