MCPcopy Create free account
hub / github.com/astercloud/aster / TestSkillCallTool_InvalidSkill

Function TestSkillCallTool_InvalidSkill

pkg/tools/builtin/skillcall_test.go:77–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestSkillCallTool_InvalidSkill(t *testing.T) {
78 t.Skip("Skipping: requires Services runtime (ToolContext.Services is nil in tests)")
79 tool, err := NewSkillTool(nil)
80 if err != nil {
81 t.Fatalf("Failed to create SkillCall tool: %v", err)
82 }
83
84 input := map[string]any{
85 "skill": "nonexistent_skill",
86 }
87
88 result := ExecuteToolWithInput(t, tool, input)
89
90 // 应该返回错误或失败响应
91 if result["ok"].(bool) {
92 t.Log("Skill call succeeded (unexpected in test environment)")
93 } else {
94 errMsg := AssertToolError(t, result)
95 if !contains(errMsg, "not found") && !contains(errMsg, "invalid") && !contains(errMsg, "unknown") {
96 t.Logf("Skill call failed with expected error: %s", errMsg)
97 }
98 }
99}
100
101func TestSkillCallTool_WithParameters(t *testing.T) {
102 t.Skip("Skipping: requires Services runtime (ToolContext.Services is nil in tests)")

Callers

nothing calls this directly

Calls 5

NewSkillToolFunction · 0.85
ExecuteToolWithInputFunction · 0.85
AssertToolErrorFunction · 0.85
containsFunction · 0.70
LogMethod · 0.65

Tested by

no test coverage detected