-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor imports and improve print statement formatting in SwarmFactory
- Rearranged import statements in swarm_factory.py for clarity. - Enhanced the print statement in the spawn department method for better readability. - Updated test assertions in test_swarm_factory.py for improved clarity and specificity. These changes aim to enhance code readability and maintainability across the project.
- Loading branch information
1 parent
d2f6a9e
commit d42a000
Showing
2 changed files
with
44 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
import unittest | ||
"""Tests for SwarmFactory.""" | ||
|
||
from smolswarms.swarm_factory import SwarmFactory | ||
|
||
class TestSwarmFactory(unittest.TestCase): | ||
def test_spawn_department_optimize_tokens(self): | ||
factory = SwarmFactory() | ||
swarm = factory.spawn_department({ | ||
"business_unit": "test_team", | ||
|
||
def test_spawn_department() -> None: | ||
"""Test spawning a department.""" | ||
factory = SwarmFactory() | ||
swarm = factory.spawn_department( | ||
{ | ||
"business_unit": "growth_team", | ||
"budget": "optimize_tokens", | ||
"vibe": "test_vibe" | ||
}) | ||
self.assertIsNone(swarm) # Add more specific assertions based on expected behavior | ||
"vibe": "hypergrowth", | ||
} | ||
) | ||
assert swarm is None | ||
|
||
def test_spawn_department_default_budget(self): | ||
factory = SwarmFactory() | ||
swarm = factory.spawn_department({ | ||
"business_unit": "test_team", | ||
"budget": "default", | ||
"vibe": "test_vibe" | ||
}) | ||
self.assertIsNone(swarm) # Add more specific assertions based on expected behavior | ||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
def test_spawn_department_with_different_budget() -> None: | ||
"""Test spawning a department with a different budget.""" | ||
factory = SwarmFactory() | ||
swarm = factory.spawn_department( | ||
{ | ||
"business_unit": "growth_team", | ||
"budget": "unlimited", | ||
"vibe": "hypergrowth", | ||
} | ||
) | ||
assert swarm is None |