restic/src/restic/archiver/testing.go

17 lines
349 B
Go
Raw Normal View History

2016-09-04 12:52:43 +02:00
package archiver
import (
"restic"
"testing"
)
// TestSnapshot creates a new snapshot of path.
func TestSnapshot(t testing.TB, repo restic.Repository, path string, parent *restic.ID) *restic.Snapshot {
arch := New(repo)
2016-09-13 20:12:55 +02:00
sn, _, err := arch.Snapshot(nil, []string{path}, []string{"test"}, parent)
2016-09-04 12:52:43 +02:00
if err != nil {
t.Fatal(err)
}
return sn
}