|
1 | | -import pytest |
2 | 1 | from unittest.mock import Mock, patch |
3 | 2 |
|
| 3 | +import pytest |
| 4 | + |
| 5 | +from swarms.structs.agent import Agent |
4 | 6 | from swarms.structs.swarm_router import ( |
5 | 7 | SwarmRouter, |
6 | 8 | SwarmRouterConfig, |
7 | | - SwarmRouterRunError, |
8 | 9 | SwarmRouterConfigError, |
9 | | - Document, |
| 10 | + SwarmRouterRunError, |
10 | 11 | ) |
11 | | -from swarms.structs.agent import Agent |
12 | 12 |
|
13 | 13 |
|
14 | 14 | @pytest.fixture |
@@ -127,27 +127,6 @@ def test_initialization_with_agent_rearrange_flow(sample_agents): |
127 | 127 | assert router.rearrange_flow == flow |
128 | 128 |
|
129 | 129 |
|
130 | | -def test_initialization_with_shared_memory(sample_agents): |
131 | | - """Test SwarmRouter with shared memory system.""" |
132 | | - mock_memory = Mock() |
133 | | - router = SwarmRouter( |
134 | | - agents=sample_agents, |
135 | | - shared_memory_system=mock_memory, |
136 | | - ) |
137 | | - |
138 | | - assert router.shared_memory_system == mock_memory |
139 | | - |
140 | | - |
141 | | -def test_initialization_with_worker_tools(sample_agents): |
142 | | - """Test SwarmRouter with worker tools.""" |
143 | | - mock_tool = Mock() |
144 | | - router = SwarmRouter( |
145 | | - agents=sample_agents, |
146 | | - worker_tools=[mock_tool], |
147 | | - ) |
148 | | - |
149 | | - assert router.worker_tools == [mock_tool] |
150 | | - |
151 | 130 |
|
152 | 131 | def test_invalid_swarm_type(): |
153 | 132 | """Test error when invalid swarm type is provided.""" |
@@ -660,20 +639,6 @@ def test_handle_rules(sample_agents): |
660 | 639 | ) |
661 | 640 |
|
662 | 641 |
|
663 | | -def test_activate_shared_memory(sample_agents): |
664 | | - """Test activate_shared_memory method.""" |
665 | | - mock_memory = Mock() |
666 | | - router = SwarmRouter( |
667 | | - agents=sample_agents, |
668 | | - shared_memory_system=mock_memory, |
669 | | - ) |
670 | | - |
671 | | - router.activate_shared_memory() |
672 | | - |
673 | | - # Check that all agents have the shared memory system |
674 | | - for agent in router.agents: |
675 | | - assert agent.long_term_memory == mock_memory |
676 | | - |
677 | 642 |
|
678 | 643 | def test_update_system_prompt_for_agent_in_swarm(sample_agents): |
679 | 644 | """Test update_system_prompt_for_agent_in_swarm method.""" |
@@ -928,13 +893,6 @@ def test_swarm_router_config_model(): |
928 | 893 | assert config.multi_agent_collab_prompt is True |
929 | 894 |
|
930 | 895 |
|
931 | | -def test_document_model(): |
932 | | - """Test Document model.""" |
933 | | - doc = Document(file_path="test.txt", data="Test document content") |
934 | | - |
935 | | - assert doc.file_path == "test.txt" |
936 | | - assert doc.data == "Test document content" |
937 | | - |
938 | 896 |
|
939 | 897 | if __name__ == "__main__": |
940 | 898 | pytest.main([__file__, "-v"]) |
0 commit comments