mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
test: add assertions for have_forced_answer state (#1815)
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -466,6 +466,8 @@ def test_agent_custom_max_iterations():
|
|||||||
tools=[get_final_answer],
|
tools=[get_final_answer],
|
||||||
)
|
)
|
||||||
assert private_mock.call_count == 2
|
assert private_mock.call_count == 2
|
||||||
|
# Verify that have_forced_answer was set to True after max iterations
|
||||||
|
assert agent.agent_executor.have_forced_answer == True, "have_forced_answer should be True after max iterations"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
@@ -566,6 +568,8 @@ def test_agent_moved_on_after_max_iterations():
|
|||||||
tools=[get_final_answer],
|
tools=[get_final_answer],
|
||||||
)
|
)
|
||||||
assert output == "The final answer is 42."
|
assert output == "The final answer is 42."
|
||||||
|
# Verify that have_forced_answer was set to True after max iterations
|
||||||
|
assert agent.agent_executor.have_forced_answer == True, "have_forced_answer should be True after max iterations"
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.vcr(filter_headers=["authorization"])
|
@pytest.mark.vcr(filter_headers=["authorization"])
|
||||||
|
|||||||
@@ -3125,4 +3125,4 @@ def test_multimodal_agent_live_image_analysis():
|
|||||||
# Verify we got a meaningful response
|
# Verify we got a meaningful response
|
||||||
assert isinstance(result.raw, str)
|
assert isinstance(result.raw, str)
|
||||||
assert len(result.raw) > 100 # Expecting a detailed analysis
|
assert len(result.raw) > 100 # Expecting a detailed analysis
|
||||||
assert "error" not in result.raw.lower() # No error messages in response
|
assert "error" not in result.raw.lower() # No error messages in response
|
||||||
|
|||||||
Reference in New Issue
Block a user