mirror of
https://github.com/dataforcanada/d4c-service-geo-assistant.git
synced 2026-06-13 14:31:01 +02:00
e3530cefd2
* Use pyupgrade (UP) rule * Use pyflakes (F) rule * Use isort (I) rule * Use ruff-specific (RUF) rules * Use flake8-commas (COM) rule * Fix UP043 Unnecessary default type arguments
31 lines
830 B
Python
31 lines
830 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
|