Files
ai-podcast/tests/test_town_geo.py
T
lukeandClaude Opus 5 2071ae4181 Track four test files that were never committed
CLAUDE.md cites tests/test_model_config.py as the guard against reintroducing
retired OpenRouter model ids, but the file existed only on disk — the guard was
not in the repository. Same for the town geo, voice roster and voicemail
transcript tests, and the Reaper bleep-selection test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-14 04:23:44 -05:00

30 lines
937 B
Python

from backend.main import _get_town_from_location, BIG_BEND_TOWNS
def test_matches_simple_town():
assert _get_town_from_location("Alpine, Texas") == "alpine"
assert _get_town_from_location("Marfa") == "marfa"
assert _get_town_from_location("outside Terlingua") == "terlingua"
def test_matches_two_word_town():
assert _get_town_from_location("Fort Stockton, TX") == "fort stockton"
assert _get_town_from_location("ft stockton") == "fort stockton"
def test_case_insensitive():
assert _get_town_from_location("MARATHON, texas") == "marathon"
def test_no_match_returns_none():
assert _get_town_from_location("Albuquerque, New Mexico") is None
assert _get_town_from_location("") is None
def test_every_town_has_coords():
for town, coords in BIG_BEND_TOWNS.items():
assert town == town.lower()
lat, lon = coords
assert 28.0 < lat < 32.0
assert -105.0 < lon < -102.0