forked from innovacion/searchbox
Rename package to searchbox
This commit renames the package from vector-search-mcp to searchbox. The package imports and executable name are updated accordingly.
This commit is contained in:
@@ -2,9 +2,9 @@ from unittest.mock import MagicMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from vector_search_mcp.engine import Backend, get_engine, UnknownEngineError
|
||||
from vector_search_mcp.engine.base_engine import BaseEngine
|
||||
from vector_search_mcp.engine.qdrant_engine import QdrantEngine
|
||||
from searchbox.engine import Backend, get_engine, UnknownEngineError
|
||||
from searchbox.engine.base_engine import BaseEngine
|
||||
from searchbox.engine.qdrant_engine import QdrantEngine
|
||||
|
||||
|
||||
class TestEngineFactory:
|
||||
@@ -19,10 +19,10 @@ class TestEngineFactory:
|
||||
"""Test get_engine returns QdrantEngine for QDRANT type"""
|
||||
with (
|
||||
patch(
|
||||
"vector_search_mcp.engine.qdrant_engine.Settings"
|
||||
"searchbox.engine.qdrant_engine.Settings"
|
||||
) as mock_settings_class,
|
||||
patch(
|
||||
"vector_search_mcp.engine.qdrant_engine.AsyncQdrantClient"
|
||||
"searchbox.engine.qdrant_engine.AsyncQdrantClient"
|
||||
) as mock_client_class,
|
||||
):
|
||||
# Setup mocks
|
||||
@@ -59,8 +59,8 @@ class TestEngineFactory:
|
||||
def test_get_engine_typing_literal_qdrant(self):
|
||||
"""Test that get_engine with literal QDRANT returns correct type"""
|
||||
with (
|
||||
patch("vector_search_mcp.engine.qdrant_engine.Settings"),
|
||||
patch("vector_search_mcp.engine.qdrant_engine.AsyncQdrantClient"),
|
||||
patch("searchbox.engine.qdrant_engine.Settings"),
|
||||
patch("searchbox.engine.qdrant_engine.AsyncQdrantClient"),
|
||||
):
|
||||
# When using literal Backend.QDRANT, mypy should know it's QdrantEngine
|
||||
engine = get_engine(Backend.QDRANT)
|
||||
@@ -73,8 +73,8 @@ class TestEngineFactory:
|
||||
def test_get_engine_typing_variable(self):
|
||||
"""Test that get_engine with variable returns BaseEngine type"""
|
||||
with (
|
||||
patch("vector_search_mcp.engine.qdrant_engine.Settings"),
|
||||
patch("vector_search_mcp.engine.qdrant_engine.AsyncQdrantClient"),
|
||||
patch("searchbox.engine.qdrant_engine.Settings"),
|
||||
patch("searchbox.engine.qdrant_engine.AsyncQdrantClient"),
|
||||
):
|
||||
# When using a variable, mypy should see it as BaseEngine
|
||||
engine_type: Backend = Backend.QDRANT
|
||||
@@ -88,10 +88,10 @@ class TestEngineFactory:
|
||||
"""Test that get_engine uses cache and returns same instances"""
|
||||
with (
|
||||
patch(
|
||||
"vector_search_mcp.engine.qdrant_engine.Settings"
|
||||
"searchbox.engine.qdrant_engine.Settings"
|
||||
) as mock_settings_class,
|
||||
patch(
|
||||
"vector_search_mcp.engine.qdrant_engine.AsyncQdrantClient"
|
||||
"searchbox.engine.qdrant_engine.AsyncQdrantClient"
|
||||
) as mock_client_class,
|
||||
):
|
||||
# Setup mocks
|
||||
@@ -135,10 +135,10 @@ class TestEngineFactory:
|
||||
"""Test complete factory integration with engine functionality"""
|
||||
with (
|
||||
patch(
|
||||
"vector_search_mcp.engine.qdrant_engine.Settings"
|
||||
"searchbox.engine.qdrant_engine.Settings"
|
||||
) as mock_settings_class,
|
||||
patch(
|
||||
"vector_search_mcp.engine.qdrant_engine.AsyncQdrantClient"
|
||||
"searchbox.engine.qdrant_engine.AsyncQdrantClient"
|
||||
) as mock_client_class,
|
||||
):
|
||||
# Setup mocks
|
||||
@@ -262,8 +262,8 @@ class TestEngineFactoryErrorHandling:
|
||||
def test_engine_initialization_failure(self):
|
||||
"""Test handling of engine initialization failures"""
|
||||
with (
|
||||
patch("vector_search_mcp.engine.qdrant_engine.Settings") as mock_settings,
|
||||
patch("vector_search_mcp.engine.qdrant_engine.AsyncQdrantClient"),
|
||||
patch("searchbox.engine.qdrant_engine.Settings") as mock_settings,
|
||||
patch("searchbox.engine.qdrant_engine.AsyncQdrantClient"),
|
||||
):
|
||||
# Make Settings initialization raise an exception
|
||||
mock_settings.side_effect = Exception("Settings initialization failed")
|
||||
|
||||
Reference in New Issue
Block a user