"""{{ display_name }} MCP server — generated by mcpify. Do not hand-edit.

Monkeypatches `embed` to a fixed vector matching `conftest.seeded_db_path`'s
hand-crafted `FLOAT[4]` embeddings, so this test doesn't pay
`sentence-transformers`' real model-load cost.
"""

from __future__ import annotations

import aiosqlite
import pytest

import {{ module_name }}.tools.search_tool as search_tool_module


async def test_search_operations_finds_the_nearest_neighbor(
    store_conn: aiosqlite.Connection, monkeypatch: pytest.MonkeyPatch
) -> None:
    monkeypatch.setattr(search_tool_module, "embed", lambda _query: [1.0, 0.0, 0.0, 0.0])

    results = await search_tool_module.search_operations(store_conn, "list widgets", 5)

    assert len(results) == 1
    assert results[0]["operation_id"] == "listWidgets"
    assert results[0]["similarity"] > 0.99
