1
0
mirror of https://github.com/restic/restic.git synced 2024-06-30 08:20:55 +02:00
restic/internal/archiver/testing.go
Alexander Neumann 6caeff2408 Run goimports
2017-07-23 14:21:03 +02:00

19 lines
417 B
Go

package archiver
import (
"context"
"testing"
"github.com/restic/restic/internal"
)
// 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)
sn, _, err := arch.Snapshot(context.TODO(), nil, []string{path}, []string{"test"}, "localhost", parent)
if err != nil {
t.Fatal(err)
}
return sn
}