lvvignesh2122's picture
feat: Masters Level Upgrade - SQL Hybrid Agent, Docker, Tests, and RAGAS Eval
4e0f514
raw
history blame contribute delete
647 Bytes
import pytest
from rag_store import search_knowledge
# Note: We are testing the import and basic function existence.
# Testing FAISS requires mocking or a real index.
def test_search_knowledge_empty():
# If no index exists or empty query, what happens?
# This assumes dependencies are installed.
# We expect a list (maybe empty) or error if no index.
try:
results = search_knowledge("test query")
assert isinstance(results, list)
except Exception as e:
# If index not found, that's also a valid "state" for a unit test to catch
assert "index" in str(e).lower() or "not found" in str(e).lower()