master
Kye Gomez 18 hours ago
parent 638e9e2ba2
commit b51bc2093b

@ -1,4 +1,3 @@
# from unittest.mock import Mock, patch
from swarms.structs.agent_router import AgentRouter

@ -159,7 +159,7 @@ def test_concurrent_workflow_error_handling():
"""Test ConcurrentWorkflow error handling and validation"""
# Test with empty agents list
try:
workflow = ConcurrentWorkflow(agents=[])
ConcurrentWorkflow(agents=[])
assert (
False
), "Should have raised ValueError for empty agents list"
@ -168,7 +168,7 @@ def test_concurrent_workflow_error_handling():
# Test with None agents
try:
workflow = ConcurrentWorkflow(agents=None)
ConcurrentWorkflow(agents=None)
assert False, "Should have raised ValueError for None agents"
except ValueError as e:
assert "No agents provided" in str(e)

@ -210,7 +210,7 @@ def test_hierarchical_swarm_error_handling():
"""Test HierarchicalSwarm error handling"""
# Test with empty agents list
try:
swarm = HierarchicalSwarm(agents=[])
HierarchicalSwarm(agents=[])
assert (
False
), "Should have raised ValueError for empty agents list"
@ -228,7 +228,7 @@ def test_hierarchical_swarm_error_handling():
)
try:
swarm = HierarchicalSwarm(agents=[researcher], max_loops=0)
HierarchicalSwarm(agents=[researcher], max_loops=0)
assert (
False
), "Should have raised ValueError for invalid max_loops"

@ -178,21 +178,21 @@ def test_majority_voting_error_handling():
def test_majority_voting_different_output_types():
"""Test MajorityVoting with different output types"""
# Create agents for technical analysis
security_expert = Agent(
Agent(
agent_name="Security-Expert",
agent_description="Cybersecurity and data protection specialist",
model_name="gpt-4o",
max_loops=1,
)
compliance_officer = Agent(
Agent(
agent_name="Compliance-Officer",
agent_description="Regulatory compliance and legal specialist",
model_name="gpt-4o",
max_loops=1,
)
privacy_advocate = Agent(
Agent(
agent_name="Privacy-Advocate",
agent_description="Privacy protection and data rights specialist",
model_name="gpt-4o",

Loading…
Cancel
Save