mirror of https://github.com/aliasrobotics/cai.git
add more test
This commit is contained in:
parent
9532fe42f5
commit
75869265a5
|
|
@ -26,8 +26,8 @@ from cai.sdk.agents import (
|
|||
from cai.sdk.agents.agent import ToolsToFinalOutputResult
|
||||
from cai.sdk.agents.tool import FunctionToolResult, function_tool
|
||||
|
||||
from .fake_model import FakeModel
|
||||
from .test_responses import (
|
||||
from tests.fake_model import FakeModel
|
||||
from tests.test_responses import (
|
||||
get_final_output_message,
|
||||
get_function_tool,
|
||||
get_function_tool_call,
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ from cai.sdk.agents.items import RunItem
|
|||
from cai.sdk.agents.run import RunConfig
|
||||
from cai.sdk.agents.stream_events import AgentUpdatedStreamEvent
|
||||
|
||||
from .fake_model import FakeModel
|
||||
from .test_responses import (
|
||||
from tests.fake_model import FakeModel
|
||||
from tests.test_responses import (
|
||||
get_final_output_message,
|
||||
get_function_tool,
|
||||
get_function_tool_call,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
import pytest
|
||||
import json
|
||||
import asyncio
|
||||
from unittest.mock import MagicMock
|
||||
from unittest.mock import patch
|
||||
from cai.tools.reconnaissance.generic_linux_command import generic_linux_command
|
||||
|
||||
|
||||
async def test_generic_linux_command_regular_commands():
|
||||
mock_ctx = MagicMock()
|
||||
params = {
|
||||
"command": "echo",
|
||||
"args": "'hello'"
|
||||
}
|
||||
|
||||
result = await generic_linux_command.on_invoke_tool(mock_ctx, json.dumps(params))
|
||||
|
||||
assert result.replace("\n", "") == 'hello'
|
||||
Loading…
Reference in New Issue