From 06b380e8137fb4dde8ff72de646872df84ead68d Mon Sep 17 00:00:00 2001 From: dajiaohuang Date: Sun, 13 Sep 2026 15:10:33 +0800 Subject: [PATCH] test: cover vector store index default isolation --- .../test_vector_store_registry.py | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/test_litellm/vector_stores/test_vector_store_registry.py b/tests/test_litellm/vector_stores/test_vector_store_registry.py index 4d8b16ada5e..420cc4da032 100644 --- a/tests/test_litellm/vector_stores/test_vector_store_registry.py +++ b/tests/test_litellm/vector_stores/test_vector_store_registry.py @@ -11,9 +11,13 @@ from datetime import datetime, timezone from unittest.mock import MagicMock import litellm -from litellm.types.vector_stores import LiteLLM_ManagedVectorStore +from litellm.types.vector_stores import ( + IndexCreateLiteLLMParams, + LiteLLM_ManagedVectorStore, + LiteLLM_ManagedVectorStoreIndex, +) from litellm.vector_stores.main import search -from litellm.vector_stores.vector_store_registry import VectorStoreRegistry +from litellm.vector_stores.vector_store_registry import VectorStoreIndexRegistry, VectorStoreRegistry @pytest.fixture(autouse=True) @@ -87,6 +91,24 @@ def test_vector_store_registries_do_not_share_default_list(): assert second.vector_stores == [] +def test_vector_store_index_registries_do_not_share_default_list(): + first = VectorStoreIndexRegistry() + second = VectorStoreIndexRegistry() + + first.vector_store_indexes.append( + LiteLLM_ManagedVectorStoreIndex( + id="first", + index_name="first", + litellm_params=IndexCreateLiteLLMParams( + vector_store_index="first", + vector_store_name="first", + ), + ) + ) + + assert second.vector_store_indexes == [] + + def test_add_vector_store_to_registry(): """Test that add_vector_store_to_registry adds vector store correctly when there are pre-existing stores""" # Create pre-existing vector stores