test: Task1审查补强——US确定性断言+版本下限对齐
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -11,4 +11,4 @@ pydantic-settings>=2.0.0
|
|||||||
python-dotenv>=1.0.0
|
python-dotenv>=1.0.0
|
||||||
sniffio>=1.3.0
|
sniffio>=1.3.0
|
||||||
iptocc>=0.1.0
|
iptocc>=0.1.0
|
||||||
phonenumberslite
|
phonenumberslite>=9.0
|
||||||
|
|||||||
@@ -11,3 +11,8 @@ def test_country_names_ca_bug_fixed():
|
|||||||
from app.services import ip_service
|
from app.services import ip_service
|
||||||
assert ip_service.COUNTRY_NAMES.get("CA") == "加拿大"
|
assert ip_service.COUNTRY_NAMES.get("CA") == "加拿大"
|
||||||
assert ip_service.COUNTRY_NAMES.get("AU") == "澳大利亚"
|
assert ip_service.COUNTRY_NAMES.get("AU") == "澳大利亚"
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_region_code_known_ip_deterministic():
|
||||||
|
from app.services.ip_service import resolve_region_code
|
||||||
|
assert resolve_region_code("8.8.8.8") == "US" # Google DNS, 离线库确定性
|
||||||
|
|||||||
Reference in New Issue
Block a user