Skip to content

Commit

Permalink
fix integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Sep 12, 2024
1 parent e155f0e commit 86f028f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/elasticsearch/tests/integration_tests/test_retrievers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def test_user_agent_header(self, es_client: Elasticsearch, index_name: str) -> N
assert retriever.es_client
user_agent = retriever.es_client._headers["User-Agent"]
assert (
re.match(r"^langchain-py-r/\d+\.\d+\.\d+(?:rc\d+)?$", user_agent)
re.match(
r"^langchain-py-r/\d+\.\d+\.\d+(?:rc\d+)?(?:\.dev\d+)?$", user_agent
)
is not None
), f"The string '{user_agent}' does not match the expected pattern."

Expand All @@ -68,7 +70,9 @@ def test_user_agent_header(self, es_client: Elasticsearch, index_name: str) -> N
search_request = es_client.transport.requests[-1] # type: ignore[attr-defined]
user_agent = search_request["headers"]["User-Agent"]
assert (
re.match(r"^langchain-py-r/\d+\.\d+\.\d+(?:rc\d+)?$", user_agent)
re.match(
r"^langchain-py-r/\d+\.\d+\.\d+(?:rc\d+)?(?:\.dev\d+)?$", user_agent
)
is not None
), f"The string '{user_agent}' does not match the expected pattern."

Expand Down

0 comments on commit 86f028f

Please sign in to comment.