(t *testing.T)
| 92 | } |
| 93 | |
| 94 | func TestToolsValidation(t *testing.T) { |
| 95 | withFakeCatalog(t) |
| 96 | p := NewBuiltinToolsPlugin() |
| 97 | |
| 98 | if _, err := p.Execute(context.Background(), []string{`{"cmd":"describe","args":{}}`}); err == nil || !strings.Contains(err.Error(), `"name" is required`) { |
| 99 | t.Fatalf("missing name must error, got %v", err) |
| 100 | } |
| 101 | if _, err := p.Execute(context.Background(), []string{`{"cmd":"install"}`}); err == nil || !strings.Contains(err.Error(), "unknown cmd") { |
| 102 | t.Fatalf("unknown cmd must error, got %v", err) |
| 103 | } |
| 104 | SetToolCatalogAdapter(nil) |
| 105 | if _, err := p.Execute(context.Background(), []string{`{"cmd":"list"}`}); err == nil { |
| 106 | t.Fatal("missing adapter must error, not panic") |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func TestToolsCaps(t *testing.T) { |
| 111 | p := NewBuiltinToolsPlugin() |
nothing calls this directly
no test coverage detected