update
This commit is contained in:
+10
-5
@@ -102,8 +102,13 @@ TOOLS_DIR = joinpath(@__DIR__, "..", "src", "tools")
|
||||
# ------------------------------------------------------------------ #
|
||||
registry_tools = getTools()
|
||||
@test !isempty(registry_tools)
|
||||
@test any(t -> t.name == "getTime", registry_tools)
|
||||
@test any(t -> t.name == "getWeather", registry_tools)
|
||||
@test "getTime" in keys(registry_tools)
|
||||
@test "getWeather" in keys(registry_tools)
|
||||
# listTools is auto-registered via __init__() → first key, then tools loaded alphabetically
|
||||
@test collect(keys(registry_tools))[1] == "listTools"
|
||||
@test collect(keys(registry_tools))[2] == "getTime"
|
||||
@test collect(keys(registry_tools))[3] == "getWeather"
|
||||
@test collect(keys(registry_tools))[4] == "writeTool"
|
||||
|
||||
clearTools()
|
||||
@test isempty(getTools())
|
||||
@@ -121,9 +126,9 @@ TOOLS_DIR = joinpath(@__DIR__, "..", "src", "tools")
|
||||
)
|
||||
registerTool(test_tool)
|
||||
reg = getTools()
|
||||
@test any(t -> t.name == "manualTool", reg)
|
||||
@test count(t -> t.name == "manualTool", reg) == 1
|
||||
@test reg[1].parallelToolExecute == true
|
||||
@test haskey(reg, "manualTool")
|
||||
@test length(reg) == 1
|
||||
@test reg["manualTool"].parallelToolExecute == true
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# 8. getTools returns deep copy (mutations don't affect registry) #
|
||||
|
||||
Reference in New Issue
Block a user