Make get time tool use system tool
This commit is contained in:
@@ -31,3 +31,27 @@ async def test_code_interpreter_blocks_import_and_io():
|
||||
)
|
||||
assert result["status"]["code"] == 422
|
||||
assert result["status"]["message"] == "invalid_code"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_current_time_uses_local_system_clock(monkeypatch):
|
||||
async def _should_not_be_called(_tool_id):
|
||||
raise AssertionError("fetch_tool_resource should not be called for current_time")
|
||||
|
||||
monkeypatch.setattr("core.tool_executor.fetch_tool_resource", _should_not_be_called)
|
||||
|
||||
result = await execute_server_tool(
|
||||
{
|
||||
"id": "call_time_ok",
|
||||
"function": {
|
||||
"name": "current_time",
|
||||
"arguments": "{}",
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
assert result["status"]["code"] == 200
|
||||
assert result["status"]["message"] == "ok"
|
||||
assert "local_time" in result["output"]
|
||||
assert "iso" in result["output"]
|
||||
assert "timestamp" in result["output"]
|
||||
|
||||
Reference in New Issue
Block a user