MCPcopy Index your code
hub / github.com/dnote/dnote / CopyFixture

Function CopyFixture

pkg/cli/testutils/main.go:70–85  ·  view source on GitHub ↗

CopyFixture writes the content of the given fixture to the filename inside the dnote dir

(t *testing.T, ctx context.DnoteCtx, fixturePath string, filename string)

Source from the content-addressed store, hash-verified

68
69// CopyFixture writes the content of the given fixture to the filename inside the dnote dir
70func CopyFixture(t *testing.T, ctx context.DnoteCtx, fixturePath string, filename string) {
71 fp, err := filepath.Abs(fixturePath)
72 if err != nil {
73 t.Fatal(errors.Wrap(err, "getting the absolute path for fixture"))
74 }
75
76 dp, err := filepath.Abs(filepath.Join(ctx.Paths.LegacyDnote, filename))
77 if err != nil {
78 t.Fatal(errors.Wrap(err, "getting the absolute path dnote dir"))
79 }
80
81 err = utils.CopyFile(fp, dp)
82 if err != nil {
83 t.Fatal(errors.Wrap(err, "copying the file"))
84 }
85}
86
87// WriteFile writes a file with the given content and filename inside the dnote dir
88func WriteFile(ctx context.DnoteCtx, content []byte, filename string) {

Callers 7

TestMigrateToV2Function · 0.92
TestMigrateToV3Function · 0.92
TestMigrateToV4Function · 0.92
TestMigrateToV5Function · 0.92
TestMigrateToV6Function · 0.92
TestMigrateToV7Function · 0.92
TestMigrateToV8Function · 0.92

Calls 1

CopyFileFunction · 0.92

Tested by 7

TestMigrateToV2Function · 0.74
TestMigrateToV3Function · 0.74
TestMigrateToV4Function · 0.74
TestMigrateToV5Function · 0.74
TestMigrateToV6Function · 0.74
TestMigrateToV7Function · 0.74
TestMigrateToV8Function · 0.74