mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-03 08:12:39 +00:00
fix test
This commit is contained in:
@@ -1606,6 +1606,13 @@ def test_agent_with_knowledge_sources():
|
||||
def test_agent_with_knowledge_sources_works_with_test():
|
||||
content = "Brandon's favorite color is red and he likes Mexican food."
|
||||
string_source = StringKnowledgeSource(content=content)
|
||||
|
||||
with patch(
|
||||
"crewai.knowledge.storage.knowledge_storage.KnowledgeStorage"
|
||||
) as MockKnowledge:
|
||||
mock_knowledge_instance = MockKnowledge.return_value
|
||||
mock_knowledge_instance.sources = [string_source]
|
||||
|
||||
agent = Agent(
|
||||
role="test role",
|
||||
goal="test goal",
|
||||
@@ -1617,6 +1624,7 @@ def test_agent_with_knowledge_sources_works_with_test():
|
||||
agent.create_agent_executor()
|
||||
agent_copy = agent.copy()
|
||||
|
||||
# Test that all properties were copied correctly
|
||||
assert agent_copy.role == agent.role
|
||||
assert agent_copy.goal == agent.goal
|
||||
assert agent_copy.backstory == agent.backstory
|
||||
|
||||
Reference in New Issue
Block a user