talk2map-test / test_no_places.py
Noel-Teens's picture
testing new workflow
bfa95ad
Raw History Blame Contribute Delete
1.28 kB
#!/usr/bin/env python3
"""
Test script to verify improved error messages when no places are found.
"""
import json
from agent.agent_runner import run_agent
def test_no_places_scenarios():
"""Test different scenarios where no places are found."""
print("Testing improved error messages for no places found...\n")
# Test 1: Query with bounding box but no places found
print("Test 1: Query with bounding box (should say area doesn't have requested places)")
bbox = {
"north_east": {"lat": 0.001, "lon": 0.001}, # Very small area with no places
"south_west": {"lat": 0.0, "lon": 0.0}
}
result1 = run_agent("restaurants", [], bbox=bbox)
print(f"Result: {result1['final_text']}")
print()
# Test 2: Query without bounding box
print("Test 2: Query without bounding box (should suggest nearby city)")
result2 = run_agent("nonexistent_place_type_xyz", [])
print(f"Result: {result2['final_text']}")
print()
# Test 3: Bounding box only (no query)
print("Test 3: Bounding box only, no query")
result3 = run_agent("", [], bbox=bbox)
print(f"Result: {result3['final_text']}")
print()
print("All tests completed!")
if __name__ == "__main__":
test_no_places_scenarios()