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

Function TestInstallItem

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

Source from the content-addressed store, hash-verified

586}
587
588func TestInstallItem(t *testing.T) {
589 ctx := context.Background()
590 dir := t.TempDir()
591 t.Setenv("HOME", dir)
592
593 s := NewStore(filepath.Join(dir, "cam.db"))
594 svc := NewService(s)
595
596 s.Init(ctx)
597 s.UpsertItem(ctx, Item{
598 Kind: "skill",
599 Name: "test-install-skill",
600 InstallKey: "test/repo:test-install-skill",
601 RepoOwner: "test",
602 RepoName: "repo",
603 RepoBranch: "main",
604 ItemPath: "skills",
605 TargetApps: "claude",
606 })
607
608 err := svc.Install(ctx, "skill", "test/repo:test-install-skill", "claude")
609 if err != nil {
610 t.Fatalf("Install: %v", err)
611 }
612
613 item, _ := s.GetItem(ctx, "skill", "test/repo:test-install-skill")
614 if !item.Installed {
615 t.Fatal("expected installed=true after Install")
616 }
617}

Callers

nothing calls this directly

Calls 6

InitMethod · 0.95
UpsertItemMethod · 0.95
InstallMethod · 0.95
GetItemMethod · 0.95
NewServiceFunction · 0.85
NewStoreFunction · 0.70

Tested by

no test coverage detected