mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-08 11:56:59 +00:00
ff7164b9ec
* fix: resolve RAG manager search signature TypeError and adjust similarity threshold * fix: revert similarity threshold change to keep PR focused * test(rag): remove trailing whitespace --------- Co-authored-by: Alexandre Teixeira <alexandremagteixeira@gmail.com>
23 lines
811 B
Python
23 lines
811 B
Python
import unittest
|
|
from unittest.mock import MagicMock, patch
|
|
from src.rag_manager import RAGManager
|
|
|
|
class TestRAGManagerSearchSignature(unittest.TestCase):
|
|
@patch('src.rag_manager.VectorRAG')
|
|
def test_search_signature_accepts_owner(self, mock_vector_rag_class):
|
|
# Create a mock instance for VectorRAG
|
|
mock_vector_rag = MagicMock()
|
|
mock_vector_rag_class.return_value = mock_vector_rag
|
|
|
|
# Initialize RAGManager
|
|
manager = RAGManager()
|
|
|
|
# Test call with owner parameter
|
|
manager.search("test query", k=3, owner="user1")
|
|
|
|
# Verify that search was called on the underlying vector_rag with the correct parameters
|
|
mock_vector_rag.search.assert_called_once_with("test query", 3, owner="user1")
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|