restic/snapshot_test.go

31 lines
670 B
Go
Raw Normal View History

2014-12-05 20:45:49 +00:00
package restic_test
2014-08-04 18:47:04 +00:00
import (
"testing"
"time"
2014-12-05 20:45:49 +00:00
"github.com/restic/restic"
2015-04-26 12:46:15 +00:00
"github.com/restic/restic/server"
2015-04-09 19:15:48 +00:00
. "github.com/restic/restic/test"
2014-08-04 18:47:04 +00:00
)
2015-04-26 12:46:15 +00:00
func testSnapshot(t *testing.T, s *server.Server) {
2014-09-23 20:39:12 +00:00
var err error
2015-03-02 13:48:47 +00:00
sn, err := restic.NewSnapshot([]string{"/home/foobar"})
2015-04-09 19:15:48 +00:00
OK(t, err)
// sn.Tree, err = restic.Blob{ID: backend.ParseID("c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2")}
// ok(t, err)
2014-08-04 18:47:04 +00:00
sn.Time, err = time.Parse(time.RFC3339Nano, "2014-08-03T17:49:05.378595539+02:00")
2015-04-09 19:15:48 +00:00
OK(t, err)
2014-08-04 18:47:04 +00:00
2014-09-23 20:39:12 +00:00
// _, err = sn.Save(be)
// ok(t, err)
}
func TestSnapshot(t *testing.T) {
2015-04-26 12:46:15 +00:00
s := SetupBackend(t)
defer TeardownBackend(t, s)
2014-09-23 20:39:12 +00:00
2015-04-26 12:46:15 +00:00
testSnapshot(t, s)
2014-08-04 18:47:04 +00:00
}