|
|
|
@ -45,8 +45,8 @@ def test_autoscaler_scale_down():
|
|
|
|
|
assert len(autoscaler.agents_pool) == 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@patch("your_module.AutoScaler.scale_up")
|
|
|
|
|
@patch("your_module.AutoScaler.scale_down")
|
|
|
|
|
@patch("swarms.swarms.AutoScaler.scale_up")
|
|
|
|
|
@patch("swarms.swarms.AutoScaler.scale_down")
|
|
|
|
|
def test_autoscaler_monitor_and_scale(mock_scale_down, mock_scale_up):
|
|
|
|
|
autoscaler = AutoScaler(initial_agents=5, agent=flow)
|
|
|
|
|
autoscaler.add_task("task1")
|
|
|
|
@ -55,8 +55,8 @@ def test_autoscaler_monitor_and_scale(mock_scale_down, mock_scale_up):
|
|
|
|
|
mock_scale_down.assert_called_once()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@patch("your_module.AutoScaler.monitor_and_scale")
|
|
|
|
|
@patch("your_module.flow.run")
|
|
|
|
|
@patch("swarms.swarms.AutoScaler.monitor_and_scale")
|
|
|
|
|
@patch("swarms.swarms.flow.run")
|
|
|
|
|
def test_autoscaler_start(mock_run, mock_monitor_and_scale):
|
|
|
|
|
autoscaler = AutoScaler(initial_agents=5, agent=flow)
|
|
|
|
|
autoscaler.add_task("task1")
|
|
|
|
|