mirror of https://github.com/perkeep/perkeep.git
test: add World.NewPermanode
Change-Id: I737ae2f69b567eaebf13a3f7c786e06b791e2f7c
This commit is contained in:
parent
dfce3b3f72
commit
78c50e8151
|
@ -28,9 +28,11 @@ import (
|
|||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"camlistore.org/pkg/blob"
|
||||
"camlistore.org/pkg/osutil"
|
||||
)
|
||||
|
||||
|
@ -163,6 +165,15 @@ func (w *World) Stop() {
|
|||
}
|
||||
}
|
||||
|
||||
func (w *World) NewPermanode(t *testing.T) blob.Ref {
|
||||
out := MustRunCmd(t, w.Cmd("camput", "permanode"))
|
||||
br, ok := blob.Parse(strings.TrimSpace(out))
|
||||
if !ok {
|
||||
t.Fatalf("Expected permanode in camput stdout; got %q", out)
|
||||
}
|
||||
return br
|
||||
}
|
||||
|
||||
func (w *World) Cmd(binary string, args ...string) *exec.Cmd {
|
||||
return w.CmdWithEnv(binary, os.Environ(), args...)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue