[__INIT__][CLEANUP]

pull/299/head
Kye 1 year ago
parent fdc0163f7e
commit 88dfdcb589

@ -7,3 +7,6 @@ from swarms.swarms import * # noqa: E402, F403
from swarms.structs import * # noqa: E402, F403
from swarms.models import * # noqa: E402, F403
from swarms.telemetry import * # noqa: E402, F403
from swarms.utils import * # noqa: E402, F403
from swarms.prompts import * # noqa: E402, F403
# from swarms.cli import * # noqa: E402, F403

@ -4,8 +4,6 @@ from typing import (
Callable,
Dict,
List,
Optional,
Sequence,
Union,
)

@ -118,26 +118,49 @@ def test_task_creation():
assert task.result is None
assert task.agents == [agent]
def test_task_with_dependencies():
agent = Agent()
task = Task(id="2", task="Task2", result=None, agents=[agent], dependencies=["Task1"])
task = Task(
id="2",
task="Task2",
result=None,
agents=[agent],
dependencies=["Task1"],
)
assert task.dependencies == ["Task1"]
def test_task_with_args():
agent = Agent()
task = Task(id="3", task="Task3", result=None, agents=[agent], args=["arg1", "arg2"])
task = Task(
id="3",
task="Task3",
result=None,
agents=[agent],
args=["arg1", "arg2"],
)
assert task.args == ["arg1", "arg2"]
def test_task_with_kwargs():
agent = Agent()
task = Task(id="4", task="Task4", result=None, agents=[agent], kwargs={"kwarg1": "value1"})
task = Task(
id="4",
task="Task4",
result=None,
agents=[agent],
kwargs={"kwarg1": "value1"},
)
assert task.kwargs == {"kwarg1": "value1"}
# ... continue creating tests for different scenarios
# Test execute method
def test_execute():
agent = Agent()
task = Task(id="5", task="Task5", result=None, agents=[agent])
# Assuming execute method returns True on successful execution
assert task.execute() == True
assert task.execute() == True

Loading…
Cancel
Save