Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Jun 22, 2023
1 parent c76ace7 commit 6f8a0d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from autogpt.models.command_registry import CommandRegistry

PARAMETERS = [
CommandParameter("arg1", "int", description="Argument 1", required=False),
CommandParameter("arg1", "int", description="Argument 1", required=True),
CommandParameter("arg2", "str", description="Argument 2", required=False),
]

Expand All @@ -35,7 +35,7 @@ def test_command_creation(self):
assert cmd.name == "example"
assert cmd.description == "Example command"
assert cmd.method == self.example_command_method
assert cmd.parameters == "(arg1: int, arg2: str) -> str"
assert str(cmd) == "example: Example command, params: (arg1: int, arg2: Optional[str])"

def test_command_call(self):
"""Test that Command(*args) calls and returns the result of method(*args)."""
Expand Down Expand Up @@ -160,7 +160,7 @@ def test_get_command_prompt(self):
registry.register(cmd)
command_prompt = registry.command_prompt()

assert f"(arg1: int, arg2: str)" in command_prompt
assert f"(arg1: int, arg2: Optional[str])" in command_prompt

def test_import_mock_commands_module(self):
"""Test that the registry can import a module with mock command plugins."""
Expand Down

0 comments on commit 6f8a0d3

Please sign in to comment.