Files
d4c-service-geo-assistant/tests/tools/test_overture.py
T
Soumya Ranjan Mohanty be8affaa6c Add docs to download overture places data & ollama model (#13)
* Add docs to download overture places data & ollama model
* Hit local overture parquet files
* Add osx gitignore
* Add .env.example
* Make overture data source selectable using .env
* Add pytest marker to set right ENV vars during CI

---------

Co-authored-by: Daniel Wiesmann <yellowcap@users.noreply.github.com>
2025-12-04 22:11:10 +05:30

30 lines
828 B
Python

import os
import pytest
from langchain_core.tools.base import ToolCall
from geo_assistant.tools.overture import get_place
@pytest.fixture(autouse=True)
def setup_ci_env():
"""Configure S3 source for CI environments."""
# Detect CI environment (GitHub Actions, GitLab CI, etc.)
if os.getenv("CI") or os.getenv("GITHUB_ACTIONS"):
os.environ["OVERTURE_SOURCE"] = "s3"
os.environ["OVERTURE_S3_PATH"] = (
"s3://overturemaps-us-west-2/release/2025-11-19.0/theme=places/type=place/*"
)
yield
async def test_get_place():
command = await get_place.ainvoke(
ToolCall(
name="get_place",
type="tool_call",
id="test_id",
args={"place_name": "Neighbourhood Cafe Lisbon"},
)
)
assert "place" in command.update