修复测试:AMSC/NMC 测试适配环境变量 URL 模式

This commit is contained in:
2569718930@qq.com
2026-05-19 15:56:28 +08:00
parent 6b741cc1ec
commit 49238cf420
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -73,7 +73,8 @@ def test_parse_wind_plate_payload_rejects_unauthorized_or_empty_payloads():
assert _amsc_parse_wind_plate_payload({"code": 200, "data": {}}, city_key="beijing", icao="ZBAA") is None
def test_fetch_amsc_official_current_uses_domestic_city_whitelist():
def test_fetch_amsc_official_current_uses_domestic_city_whitelist(monkeypatch):
monkeypatch.setenv("AMSC_AWOS_BASE_URL", "https://www.amsc.net.cn/gateway/api/saas/rest/amc/AwosController/getWindPlate")
assert _amsc_supported_city_codes()["beijing"] == "ZBAA"
assert "new york" not in _amsc_supported_city_codes()