MCPcopy
hub / github.com/perkeep/perkeep / PutFile

Method PutFile

pkg/test/world.go:273–280  ·  view source on GitHub ↗
(t *testing.T, name string)

Source from the content-addressed store, hash-verified

271}
272
273func (w *World) PutFile(t *testing.T, name string) blob.Ref {
274 out := MustRunCmd(t, w.Cmd("pk-put", "file", name))
275 br, ok := blob.Parse(strings.TrimSpace(out))
276 if !ok {
277 t.Fatalf("Expected blobref in pk-put stdout; got %q", out)
278 }
279 return br
280}
281
282func (w *World) Cmd(binary string, args ...string) *exec.Cmd {
283 return w.CmdWithEnv(binary, os.Environ(), args...)

Callers 1

TestReadFileFromRootFunction · 0.80

Implementers 2

testWorldpkg/gc/gc_test.go
Worldpkg/test/world.go

Calls 4

CmdMethod · 0.95
ParseFunction · 0.92
MustRunCmdFunction · 0.85
FatalfMethod · 0.65

Tested by 1

TestReadFileFromRootFunction · 0.64