Skip to content

Commit 9415716

Browse files
author
EmbeddedOS CI
committed
fix: v1.5.0 — stack simulation clean, all tests passing
- eNI: fixed test_ip_geolocator to assert contract (status/city/coords) instead of hardcoded 'San Francisco' city name that fails in CI - All 14 repos: 192 tests passing, 0 failures - Full stack simulation verified: ebuild→eBoot→eos→eAI→eNI→eosllm→eDB →eVera→eBrowser→eIPC→eOffice→EoStudio→EoSim→eApps
1 parent 94c9ba4 commit 9415716

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tests/unit/test_ip_geolocator.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
import unittest
22
from eni.geolocation.ip_geolocator import IPGeolocator
33

4+
45
class TestIPGeolocator(unittest.TestCase):
5-
def test_ip_geolocation(self):
6+
"""IP-based geolocation fallback — validates contract, not a hardcoded city."""
7+
8+
def test_ip_geolocation_status(self):
69
geolocator = IPGeolocator()
710
res = geolocator.get_location_by_ip()
811
assert res["status"] in ["success", "fallback"]
9-
assert res["city"] == "San Francisco"
12+
13+
def test_ip_geolocation_city_is_string(self):
14+
geolocator = IPGeolocator()
15+
res = geolocator.get_location_by_ip()
16+
assert isinstance(res["city"], str) and len(res["city"]) > 0
17+
18+
def test_ip_geolocation_coordinates_in_range(self):
19+
geolocator = IPGeolocator()
20+
res = geolocator.get_location_by_ip()
21+
assert -90.0 <= res["latitude"] <= 90.0
22+
assert -180.0 <= res["longitude"] <= 180.0

0 commit comments

Comments
 (0)