From 463a33e26b7f9d04aac6705f4ed9d83422879196 Mon Sep 17 00:00:00 2001 From: kesku Date: Wed, 14 Oct 2026 18:03:48 -0400 Subject: [PATCH] test(exa): validate domain filter by hostname --- cookbook/exa_search/validate_live.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/exa_search/validate_live.py b/cookbook/exa_search/validate_live.py index 983a9ab96c2..887a8a4a0b2 100644 --- a/cookbook/exa_search/validate_live.py +++ b/cookbook/exa_search/validate_live.py @@ -7,6 +7,7 @@ import os import time from pathlib import Path from typing import Final +from urllib.parse import urlsplit import jsonschema @@ -179,7 +180,7 @@ async def main(output: Path, selected: list[str]): assert isinstance(response["output"]["grounding"], list) if name == "domain-filter": assert response["results"] - assert all("docs.python.org" in result["url"] for result in response["results"]) + assert all(urlsplit(result["url"]).hostname == "docs.python.org" for result in response["results"]) if name in ("null-contents", "metadata-only"): assert all(not result.get("text") for result in response["results"]) records.append(