修复 NMC 移除后的测试回归:删除 NMC 相关测试用例
This commit is contained in:
@@ -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": {
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user