(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func 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 | |
| 101 | func TestSkillCallTool_WithParameters(t *testing.T) { |
| 102 | t.Skip("Skipping: requires Services runtime (ToolContext.Services is nil in tests)") |
nothing calls this directly
no test coverage detected