2
2
mirror of https://github.com/octoleo/restic.git synced 2024-06-04 01:50:48 +00:00
restic/src/restic/archiver/testing.go

17 lines
362 B
Go
Raw Normal View History

2016-09-04 10:52:43 +00: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)
2017-02-10 18:37:33 +00:00
sn, _, err := arch.Snapshot(nil, []string{path}, []string{"test"}, "localhost", parent)
2016-09-04 10:52:43 +00:00
if err != nil {
t.Fatal(err)
}
return sn
}