[__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.structs import * # noqa: E402, F403
from swarms.models import * # noqa: E402, F403 from swarms.models import * # noqa: E402, F403
from swarms.telemetry 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, Callable,
Dict, Dict,
List, List,
Optional,
Sequence,
Union, Union,
) )

@ -118,23 +118,46 @@ def test_task_creation():
assert task.result is None assert task.result is None
assert task.agents == [agent] assert task.agents == [agent]
def test_task_with_dependencies(): def test_task_with_dependencies():
agent = Agent() 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"] assert task.dependencies == ["Task1"]
def test_task_with_args(): def test_task_with_args():
agent = Agent() 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"] assert task.args == ["arg1", "arg2"]
def test_task_with_kwargs(): def test_task_with_kwargs():
agent = Agent() 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"} assert task.kwargs == {"kwarg1": "value1"}
# ... continue creating tests for different scenarios # ... continue creating tests for different scenarios
# Test execute method # Test execute method
def test_execute(): def test_execute():
agent = Agent() agent = Agent()

Loading…
Cancel
Save