Files
d4c-service-geo-assistant/tests/tools/test_summarize.py
T
Wei Ji a87b64b71e Mark test requiring ollama server as xfail (#10)
Should only run these locally for now
2025-12-04 15:29:12 +00:00

32 lines
852 B
Python

"""Tests for the satellite image summarization tool."""
import pytest
import uuid
from langchain_core.tools.base import ToolCall
from geo_assistant.tools.summarize import summarize_sat_img
# Sample test data
TEST_IMAGE_URL = "https://petapixel.com/assets/uploads/2022/08/French-Officials-Use-Satellite-Photos-and-AI-to-Spot-Unregistered-Pools-1536x806.jpg"
@pytest.mark.parametrize(
"img_url,summary",
[
(TEST_IMAGE_URL, "building"),
],
)
@pytest.mark.xfail
def test_summarize_sat_img(img_url, summary):
command = summarize_sat_img.invoke(
ToolCall(
name="summarize_sat_img",
type="tool_call",
args={"img_url": img_url},
id=str(uuid.uuid4()),
)
)
print(command.update.get("messages"))
assert summary in command.update.get("messages")[-1].content