MCPcopy Create free account
hub / github.com/diillson/chatcli / TestGraphViewPluginMetadata

Function TestGraphViewPluginMetadata

cli/plugins/builtin_graphview_test.go:186–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

184}
185
186func TestGraphViewPluginMetadata(t *testing.T) {
187 p := NewBuiltinGraphViewPlugin()
188 if p.Name() != "@graphview" {
189 t.Fatalf("name = %q", p.Name())
190 }
191 if !p.IsReadOnly(nil) || p.IsConcurrencySafe(nil) {
192 t.Fatalf("capabilities: readonly=%v concurrencySafe=%v", p.IsReadOnly(nil), p.IsConcurrencySafe(nil))
193 }
194 for _, s := range []string{p.Description(), p.Usage(), p.Version(), p.Schema()} {
195 if strings.TrimSpace(s) == "" {
196 t.Fatal("empty metadata string")
197 }
198 }
199 if p.Path() != "" {
200 t.Fatalf("path = %q, want empty", p.Path())
201 }
202 if d := p.DescribeCall(nil); d == "" {
203 t.Fatal("empty describe")
204 }
205 if d := p.DescribeCall([]string{`{"source":"knowledge"}`}); d == "" {
206 t.Fatal("empty describe for source")
207 }
208 var js map[string]interface{}
209 if err := json.Unmarshal([]byte(p.Schema()), &js); err != nil {
210 t.Fatalf("schema not valid JSON: %v", err)
211 }
212}
213
214func TestGraphViewThemeAndOpenEnv(t *testing.T) {
215 t.Setenv(graphViewThemeEnv, "light")

Callers

nothing calls this directly

Calls 10

NameMethod · 0.95
IsReadOnlyMethod · 0.95
IsConcurrencySafeMethod · 0.95
DescriptionMethod · 0.95
UsageMethod · 0.95
VersionMethod · 0.95
SchemaMethod · 0.95
PathMethod · 0.95
DescribeCallMethod · 0.95

Tested by

no test coverage detected