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

Function TestCopyFallback

internal/instructions/install_test.go:49–74  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

47}
48
49func TestCopyFallback(t *testing.T) {
50 ctx := context.Background()
51 s := newTestStore(t)
52 in, err := s.Create(ctx, "Cpy", "", "body\n")
53 if err != nil {
54 t.Fatalf("Create: %v", err)
55 }
56 old := symlinkFunc
57 symlinkFunc = func(string, string) error { return privilegeErr{} }
58 defer func() { symlinkFunc = old }()
59
60 ins, err := s.Install(ctx, in.ID, "claude", "user", "")
61 if err != nil {
62 t.Fatalf("Install: %v", err)
63 }
64 if ins.LinkKind != "copy" {
65 t.Fatalf("expected copy, got %s", ins.LinkKind)
66 }
67 data, err := os.ReadFile(ins.TargetPath)
68 if err != nil {
69 t.Fatalf("ReadFile: %v", err)
70 }
71 if string(data) != "body\n" {
72 t.Fatalf("copied content = %q", data)
73 }
74}
75
76func TestConflictTargetExists(t *testing.T) {
77 ctx := context.Background()

Callers

nothing calls this directly

Calls 4

newTestStoreFunction · 0.85
CreateMethod · 0.80
ReadFileMethod · 0.80
InstallMethod · 0.45

Tested by

no test coverage detected