feat: implement AMOS real-time weather data collection and add corresponding unit and frontend tests

This commit is contained in:
2569718930@qq.com
2026-05-27 09:07:48 +08:00
parent bef3c610b7
commit 05010d20e2
3 changed files with 98 additions and 3 deletions
+14 -1
View File
@@ -1,4 +1,8 @@
from src.data_collection.amos_station_sources import AmosStationSourceMixin, _amos_parse_runway_table
from src.data_collection.amos_station_sources import (
AmosStationSourceMixin,
_amos_extract_observation_time,
_amos_parse_runway_table,
)
def test_amos_parser_handles_current_public_page_format():
@@ -46,6 +50,15 @@ def test_amos_parser_handles_current_public_page_format():
assert parsed["rvr"][0] == 2000
def test_amos_observation_time_uses_page_kst_timestamp_as_utc_iso():
html = "[김해공항 (RKPK) 2026년 05월 27일 09:58 KST]"
obs_utc, obs_local = _amos_extract_observation_time(html, "RKPK")
assert obs_utc == "2026-05-27T00:58:00Z"
assert obs_local == "2026-05-27 09:58:00"
def test_amos_get_page_rejects_ignored_query_returning_default_rksi():
class FakeCollector(AmosStationSourceMixin):
timeout = 1.0