Add 97% test coverage

This commit is contained in:
2025-09-26 23:41:54 +00:00
parent 2b76760fe6
commit e162b0613b
7 changed files with 530 additions and 21 deletions

View File

@@ -237,6 +237,29 @@ class IncompleteEngine(BaseEngine[str, int, str]):
# Missing transform_response, run_similarity_query, create_index, transform_chunk, run_upload_chunk
@pytest.mark.asyncio
async def test_upload_chunk_workflow(self):
"""Test the complete upload_chunk workflow"""
engine = MockEngine()
from vector_search_mcp.models import Chunk, ChunkData
chunk = Chunk(
id="test-chunk-1",
vector=[0.1, 0.2, 0.3],
payload=ChunkData(
page_content="Test content",
filename="test.pdf",
page=1
)
)
result = await engine.upload_chunk("test_index", chunk)
# Verify the workflow called both transform_chunk and run_upload_chunk
assert result is True
# The MockEngine.run_upload_chunk should have been called with transformed chunk
class TestAbstractMethodEnforcement:
"""Test that abstract methods must be implemented"""