fix: Prevent Mock object issues in graph memory tests (#3627)

Co-authored-by: parshvadaftari <daftariparshva@gmail.com>
This commit is contained in:
Ronak Bhalgami
2025-10-22 03:53:12 +05:30
committed by GitHub
co-authored by parshvadaftari
parent 4a30745592
commit eb2f8a3738
3 changed files with 25 additions and 8 deletions
@@ -15,6 +15,7 @@ class TestNeptuneMemory(unittest.TestCase):
self.config = MagicMock()
self.config.graph_store.config.endpoint = "neptune-graph://test-graph"
self.config.graph_store.config.base_label = True
self.config.graph_store.threshold = 0.7
self.config.llm.provider = "openai_structured"
self.config.graph_store.llm = None
self.config.graph_store.custom_prompt = None
@@ -298,8 +299,8 @@ class TestNeptuneMemory(unittest.TestCase):
# Verify the method calls
self.assertEqual(self.mock_embedding_model.embed.call_count, 2)
self.memory_graph._search_source_node.assert_called_once_with(mock_embedding, self.user_id, threshold=0.9)
self.memory_graph._search_destination_node.assert_called_once_with(mock_embedding, self.user_id, threshold=0.9)
self.memory_graph._search_source_node.assert_called_once_with(mock_embedding, self.user_id, threshold=0.7)
self.memory_graph._search_destination_node.assert_called_once_with(mock_embedding, self.user_id, threshold=0.7)
self.memory_graph._add_entities_cypher.assert_called_once()
self.mock_graph.query.assert_called_once_with(mock_cypher, params=mock_params)