tests updated

This commit is contained in:
Tobias Klein 2017-09-02 19:28:09 +02:00
parent 43ff971dfd
commit 087c3fe1dc
4 changed files with 7 additions and 5 deletions

View File

@ -108,7 +108,7 @@ func archiveDirectory(b testing.TB) {
arch := archiver.New(repo)
_, id, err := arch.Snapshot(context.TODO(), nil, []string{BenchArchiveDirectory}, nil, "localhost", nil)
_, id, err := arch.Snapshot(context.TODO(), nil, []string{BenchArchiveDirectory}, nil, "localhost", nil, time.Now())
OK(b, err)
b.Logf("snapshot archived as %v", id)
@ -302,7 +302,7 @@ func TestArchiveEmptySnapshot(t *testing.T) {
arch := archiver.New(repo)
sn, id, err := arch.Snapshot(context.TODO(), nil, []string{"file-does-not-exist-123123213123", "file2-does-not-exist-too-123123123"}, nil, "localhost", nil)
sn, id, err := arch.Snapshot(context.TODO(), nil, []string{"file-does-not-exist-123123213123", "file2-does-not-exist-too-123123123"}, nil, "localhost", nil, time.Now())
if err == nil {
t.Errorf("expected error for empty snapshot, got nil")
}

View File

@ -7,6 +7,7 @@ import (
"path/filepath"
"sort"
"testing"
"time"
"github.com/restic/restic/internal/archiver"
"github.com/restic/restic/internal/checker"
@ -305,7 +306,7 @@ func TestCheckerModifiedData(t *testing.T) {
defer cleanup()
arch := archiver.New(repo)
_, id, err := arch.Snapshot(context.TODO(), nil, []string{"."}, nil, "localhost", nil)
_, id, err := arch.Snapshot(context.TODO(), nil, []string{"."}, nil, "localhost", nil, time.Now())
test.OK(t, err)
t.Logf("archived as %v", id.Str())

View File

@ -2,6 +2,7 @@ package restic_test
import (
"testing"
"time"
"github.com/restic/restic/internal/restic"
. "github.com/restic/restic/internal/test"
@ -10,6 +11,6 @@ import (
func TestNewSnapshot(t *testing.T) {
paths := []string{"/home/foobar"}
_, err := restic.NewSnapshot(paths, nil, "foo")
_, err := restic.NewSnapshot(paths, nil, "foo", time.Now())
OK(t, err)
}

View File

@ -25,7 +25,7 @@ func TestWalkTree(t *testing.T) {
// archive a few files
arch := archiver.New(repo)
sn, _, err := arch.Snapshot(context.TODO(), nil, dirs, nil, "localhost", nil)
sn, _, err := arch.Snapshot(context.TODO(), nil, dirs, nil, "localhost", nil, time.Now())
OK(t, err)
// flush repo, write all packs