import pytest

from app.resolve import ResolveService


@pytest.mark.anyio
async def test_resolve_tool_is_stubbed_and_returns_ok():
    async def no_hit(_s):
        return None

    async def no_persist(_e):
        return None

    async def no_wikidata(_s, _language="en", _limit=1):
        return []

    svc = ResolveService(
        load_entity_fn=no_hit,
        wikidata_lookup_fn=no_wikidata,
        persist_entity_fn=no_persist,
    )
    result = await svc.resolve(subject="anything")

    assert result["status"] in {"not_found", "ambiguous", "resolved", "error"}
    assert "meta" in result
    assert "resolution_path" in result
