Download tests/unit/test_tool_runner.py from jayc1978/aegis: direct link, hf CLI and curl.
- Browser
- Download file 886 Bytes
-
https://huggingface.co/jayc1978/aegis/resolve/main/tests/unit/test_tool_runner.py
- Command line
-
hf download hf://jayc1978/aegis/tests/unit/test_tool_runner.py
-
curl -L -o test_tool_runner.py https://huggingface.co/jayc1978/aegis/resolve/main/tests/unit/test_tool_runner.py
886 Bytes
| import pytest | |
| from aegis.core.tool_registry import ToolRegistry | |
| from aegis.core.tool_runner import ToolRunner | |
| class EchoTool: | |
| name = "echo" | |
| async def execute(self, **kwargs: object) -> object: | |
| return kwargs | |
| async def test_tool_runner_executes_registered_tool() -> None: | |
| registry = ToolRegistry([EchoTool()]) | |
| runner = ToolRunner(registry) | |
| result = await runner.execute( | |
| "echo", | |
| message="hello", | |
| value=42, | |
| ) | |
| assert result == { | |
| "message": "hello", | |
| "value": 42, | |
| } | |
| async def test_tool_runner_preserves_arguments() -> None: | |
| registry = ToolRegistry([EchoTool()]) | |
| runner = ToolRunner(registry) | |
| result = await runner.execute( | |
| "echo", | |
| alpha=1, | |
| beta=2, | |
| ) | |
| assert result == { | |
| "alpha": 1, | |
| "beta": 2, | |
| } | |