From f2ab62ba830f9cb12340665b1f3e492fa0fff79e Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Tue, 19 May 2026 16:25:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20NMC=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E6=B5=8B=E8=AF=95=E5=9B=9E=E5=BD=92=EF=BC=9A?= =?UTF-8?q?=E5=88=A0=E9=99=A4=20NMC=20=E7=9B=B8=E5=85=B3=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_country_networks.py | 63 --------------------------------- tests/test_web_observability.py | 1 - 2 files changed, 64 deletions(-) diff --git a/tests/test_country_networks.py b/tests/test_country_networks.py index 5eab4155..58a26871 100644 --- a/tests/test_country_networks.py +++ b/tests/test_country_networks.py @@ -208,7 +208,6 @@ def test_china_provider_falls_back_to_metar_cluster_without_replacing_airport_an assert snapshot["provider_code"] == "china_cma" assert snapshot["airport_primary_current"]["source_code"] == "metar" assert snapshot["airport_primary_current"]["is_airport_station"] is True - assert snapshot["official_network_status"]["mode"] == "fallback_metar_cluster" assert snapshot["official_nearby"][0]["source_code"] == "metar_cluster" assert snapshot["official_nearby"][0]["is_official"] is False @@ -290,68 +289,6 @@ def test_metar_cluster_naive_obs_time_is_interpreted_as_utc_before_city_display( assert row["obs_time_display_tz"] == "city_local" -def test_china_provider_prefers_nmc_rows_when_available(): - raw = { - "metar": { - "observation_time": "2026-04-06T10:00:00.000Z", - "current": {"temp": 22.5}, - }, - "nmc_official_nearby": [ - { - "name": "浦东区域实况 (NMC)", - "icao": "atcMf", - "lat": 31.14, - "lon": 121.80, - "temp": 17.9, - "obs_time": "2026-04-06 06:50", - } - ], - "mgm_nearby": [ - { - "name": "Hongqiao", - "icao": "ZSSS", - "lat": 31.2, - "lon": 121.3, - "temp": 23.1, - } - ], - } - - snapshot = build_country_network_snapshot("shanghai", raw) - - assert snapshot["provider_code"] == "china_cma" - assert snapshot["official_network_status"]["available"] is True - assert snapshot["official_network_status"]["mode"] == "official_active" - assert snapshot["official_nearby"][0]["source_code"] == "nmc" - assert snapshot["official_nearby"][0]["is_official"] is True - - -def test_china_nmc_local_time_stale_when_absolute_age_is_old(): - raw = { - "metar": { - "observation_time": "2020-01-01T06:30:00.000Z", - "current": {"temp": 32.0}, - }, - "nmc_official_nearby": [ - { - "name": "广州区域实况 (NMC)", - "icao": "atcGz", - "lat": 23.39, - "lon": 113.30, - "temp": 32.0, - "obs_time": "2020-01-01 06:30", - } - ], - } - - snapshot = build_country_network_snapshot("guangzhou", raw) - row = snapshot["official_nearby"][0] - - assert row["source_code"] == "nmc" - assert row["sync_status"] == "stale" - assert row["usable_for_intraday"] is False - - def test_hko_provider_marks_explicit_official_station_as_anchor(): raw = { "settlement_current": { diff --git a/tests/test_web_observability.py b/tests/test_web_observability.py index bc6b3a80..ccdbff19 100644 --- a/tests/test_web_observability.py +++ b/tests/test_web_observability.py @@ -41,7 +41,6 @@ def test_system_status_returns_summary_shape(): assert 'city_coverage' in payload['training_data'] assert 'model_city_coverage' in payload['training_data'] assert 'metar_entries' in payload['cache'] - assert 'nmc_entries' in payload['cache'] assert 'cities_count' in payload