def test_user_agent_configuration() -> None:
    """Test that user agent is properly configured."""
    # Test with SearchClient
    search_client = mock_client_with_user_agent("search")
    vector_store = create_mock_vector_store(search_client)

    # Verify user agent was added with the correct base agent string
    search_client._client._config.user_agent_policy.add_user_agent.assert_called_with(
        "llamaindex-python"
    )

    # Test with SearchIndexClient
    index_client = mock_client_with_user_agent("index")
    vector_store = create_mock_vector_store(
        index_client,
        index_name="test-index",
        index_management=IndexManagement.NO_VALIDATION,
    )

    # Verify user agent was added with the correct base agent string
    index_client._client._config.user_agent_policy.add_user_agent.assert_called_with(
        "llamaindex-python"
    )
Test that user agent is properly configured.
llama-index-integrations/vector_stores/llama-index-vector-stores-azureaisearch/tests/test_azureaisearch.py