def test_user_agent_custom(
        self, sync_client_request_saving: Elasticsearch, index: str
    ) -> None:
        """Test to make sure the user-agent is set correctly."""
        user_agent = "this is THE user_agent!"

        store = VectorStore(
            user_agent=user_agent,
            index=index,
            retrieval_strategy=BM25Strategy(),
            client=sync_client_request_saving,
        )

        assert store.client._headers["User-Agent"] == user_agent

        texts = ["foo", "bob", "baz"]
        store.add_texts(texts)

        for request in store.client.transport.requests:  # type: ignore
            assert request["headers"]["User-Agent"] == user_agent
Test to make sure the user-agent is set correctly.
test_elasticsearch/test_server/test_vectorstore/test_vectorstore.py