feat(mcp): search_org accepte track=False pour ne pas polluer Matomo

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Colin Maudry
2026-07-09 20:01:57 +02:00
parent 722694bec9
commit ce9a79f420
3 changed files with 26 additions and 2 deletions
View File
+21
View File
@@ -0,0 +1,21 @@
import src.utils.search as search_mod
from src.utils.data import DF_ACHETEURS
from src.utils.search import search_org
def test_search_org_track_false_skips_track_search(monkeypatch):
calls = []
monkeypatch.setattr(search_mod, "track_search", lambda q, c: calls.append((q, c)))
search_org(DF_ACHETEURS, "ACHETEUR", "acheteur", track=False)
assert calls == []
def test_search_org_track_true_calls_track_search(monkeypatch):
calls = []
monkeypatch.setattr(search_mod, "track_search", lambda q, c: calls.append((q, c)))
search_org(DF_ACHETEURS, "ACHETEUR", "acheteur", track=True)
assert calls == [("ACHETEUR", "home_page_search")]