2015-03-14 17:15:47 +00:00
|
|
|
package restic_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/restic/restic"
|
2015-04-09 19:15:48 +00:00
|
|
|
. "github.com/restic/restic/test"
|
2015-03-14 17:15:47 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestCache(t *testing.T) {
|
2015-06-26 20:12:04 +00:00
|
|
|
repo := SetupRepo()
|
|
|
|
defer TeardownRepo(repo)
|
2015-03-14 17:15:47 +00:00
|
|
|
|
2015-05-09 19:50:10 +00:00
|
|
|
_, err := restic.NewCache(repo, "")
|
2015-04-09 19:15:48 +00:00
|
|
|
OK(t, err)
|
2015-03-14 17:15:47 +00:00
|
|
|
|
2015-05-09 11:32:52 +00:00
|
|
|
arch := restic.NewArchiver(repo)
|
2015-03-14 17:15:47 +00:00
|
|
|
|
|
|
|
// archive some files, this should automatically cache all blobs from the snapshot
|
2015-06-28 11:15:35 +00:00
|
|
|
_, _, err = arch.Snapshot(nil, []string{BenchArchiveDirectory}, nil)
|
2015-03-14 17:15:47 +00:00
|
|
|
|
2015-04-26 15:44:38 +00:00
|
|
|
// TODO: test caching index
|
2015-03-14 17:15:47 +00:00
|
|
|
}
|