Spaces:
Sleeping
Sleeping
feat: overhaul MCP architecture with structured tool schemas, comprehensive care-mode skill definitions, and enhanced test coverage for pipelines and service integration.
79df050 | import pytest | |
| from features.mcp.tools.location.geocoding_tool import ForwardGeocodeTool | |
| async def test_forward_geocode_prefers_poi_match_for_station_queries(monkeypatch): | |
| async def fake_tdx(query): | |
| return [ | |
| { | |
| "lat": 25.0487, | |
| "lon": 121.5143, | |
| "display_name": "εΈζ°ε€§ιε°εε°δΈθ‘εΊε£Y12θ₯Ώι’", | |
| "label": "ζ‘εζ©ε ΄ζ·ιε°εθ»η«_A1", | |
| "importance": 1.0, | |
| "name": "ζ‘εζ©ε ΄ζ·ιε°εθ»η«_A1", | |
| "road": "", | |
| "house_number": "", | |
| "suburb": "", | |
| "city_district": "", | |
| "city": "", | |
| "admin": "", | |
| "postcode": "", | |
| "amenity": "", | |
| "shop": "", | |
| "building": "", | |
| "detailed_address": "εΈζ°ε€§ιε°εε°δΈθ‘εΊε£Y12θ₯Ώι’", | |
| "_kind": "markname", | |
| }, | |
| { | |
| "lat": 25.1424, | |
| "lon": 121.5066, | |
| "display_name": "ε°εεΈεζειζιη ζ΅·θ·―θ¨125δΉ2θ", | |
| "label": "ε°εεΈεζειζιη ζ΅·θ·―θ¨125δΉ2θ", | |
| "importance": 1.0, | |
| "name": "", | |
| "road": "", | |
| "house_number": "", | |
| "suburb": "", | |
| "city_district": "", | |
| "city": "", | |
| "admin": "", | |
| "postcode": "", | |
| "amenity": "", | |
| "shop": "", | |
| "building": "", | |
| "detailed_address": "ε°εεΈεζειζιη ζ΅·θ·―θ¨125δΉ2θ", | |
| "_kind": "address", | |
| }, | |
| ] | |
| monkeypatch.setattr(ForwardGeocodeTool, "_forward_geocode_tdx", fake_tdx) | |
| result = await ForwardGeocodeTool.execute({"query": "ε°εθ»η«", "limit": 1}) | |
| assert "ε°εθ»η«" in result["best_match"]["label"] | |
| assert result["best_match"]["lat"] == 25.0487 | |