forked from innovacion/searchbox
Add 97% test coverage
This commit is contained in:
@@ -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"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user