Skip to content

Commit 81d084e

Browse files
Merge pull request #1075 from MervinPraison/claude/issue-1074-20250731-1148
fix: Fix RAG integration tests to respect lazy loading pattern
2 parents 68f99ab + 6f2040e commit 81d084e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/praisonai/tests/integration/test_rag_integration.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ def test_agent_with_knowledge_config(self, sample_agent_config, mock_vector_stor
7979

8080
assert agent.name == "RAG Knowledge Agent"
8181
assert hasattr(agent, 'knowledge')
82-
# knowledge_config is passed to Knowledge constructor, not stored as attribute
82+
# With lazy loading, knowledge is None until first use
83+
assert agent._knowledge_sources is not None
84+
assert agent._knowledge_processed == False
85+
# Trigger knowledge processing
86+
agent._ensure_knowledge_processed()
8387
assert agent.knowledge is not None
8488

8589
@patch('chromadb.Client')
@@ -256,6 +260,11 @@ def test_ollama_rag_integration(self, sample_agent_config):
256260

257261
assert agent.name == "Ollama RAG Agent"
258262
assert hasattr(agent, 'knowledge')
263+
# With lazy loading, knowledge is None until first use
264+
assert agent._knowledge_sources is not None
265+
assert agent._knowledge_processed == False
266+
# Trigger knowledge processing
267+
agent._ensure_knowledge_processed()
259268
assert agent.knowledge is not None
260269

261270
@patch('chromadb.Client')

0 commit comments

Comments
 (0)