MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / TestMarkInstalled

Function TestMarkInstalled

internal/metadata/store_test.go:286–302  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

284}
285
286func TestMarkInstalled(t *testing.T) {
287 ctx := context.Background()
288 s := NewStore(filepath.Join(t.TempDir(), "cam.db"))
289 s.Init(ctx)
290 s.UpsertItem(ctx, Item{Kind: "skill", Name: "x", InstallKey: "a/b:x"})
291
292 if err := s.MarkInstalled(ctx, "skill", "a/b:x", "claude"); err != nil {
293 t.Fatalf("MarkInstalled: %v", err)
294 }
295 item, _ := s.GetItem(ctx, "skill", "a/b:x")
296 if !item.Installed {
297 t.Fatal("expected installed=true")
298 }
299 if item.InstalledTargets != "claude" {
300 t.Fatalf("unexpected targets: %s", item.InstalledTargets)
301 }
302}
303
304func TestInitMigratesPromptToInstructionIdempotent(t *testing.T) {
305 ctx := context.Background()

Callers

nothing calls this directly

Calls 5

InitMethod · 0.95
UpsertItemMethod · 0.95
MarkInstalledMethod · 0.95
GetItemMethod · 0.95
NewStoreFunction · 0.70

Tested by

no test coverage detected