restic/cache_test.go

27 lines
548 B
Go
Raw Normal View History

package restic_test
import (
"testing"
"github.com/restic/restic"
2015-04-09 21:15:48 +02:00
. "github.com/restic/restic/test"
)
func TestCache(t *testing.T) {
2015-04-26 14:46:15 +02:00
server := SetupBackend(t)
defer TeardownBackend(t, server)
key := SetupKey(t, server, "geheim")
server.SetKey(key)
_, err := restic.NewCache(server)
2015-04-09 21:15:48 +02:00
OK(t, err)
arch, err := restic.NewArchiver(server)
2015-04-09 21:15:48 +02:00
OK(t, err)
// archive some files, this should automatically cache all blobs from the snapshot
_, _, err = arch.Snapshot(nil, []string{*benchArchiveDirectory}, nil)
// TODO: test caching index
}