diff --git a/src/utils/search.py b/src/utils/search.py index 57252ae..df998ad 100644 --- a/src/utils/search.py +++ b/src/utils/search.py @@ -5,9 +5,7 @@ from src.utils.table import add_links from src.utils.tracking import track_search -def search_org( - dff: pl.DataFrame, query: str, org_type: str, track: bool = True -) -> pl.DataFrame: +def search_org(dff: pl.DataFrame, query: str, org_type: str) -> pl.DataFrame: """ Search in either 'acheteur' or 'titulaire' DataFrame. @@ -20,8 +18,7 @@ def search_org( return dff.select(pl.lit(False).alias("matches")) # Enregistrement des recherche dans Matomo - if track: - track_search(query, "home_page_search") + track_search(query, "home_page_search") # Normalize query normalized_query = unidecode(query.strip()).upper() diff --git a/tests/mcp/__init__.py b/tests/mcp/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/mcp/test_queries.py b/tests/mcp/test_queries.py deleted file mode 100644 index b560a73..0000000 --- a/tests/mcp/test_queries.py +++ /dev/null @@ -1,21 +0,0 @@ -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")]