mirror of
https://github.com/restic/restic.git
synced 2025-08-22 01:51:47 +00:00
Refactor, add Object and Snapshot
This commit is contained in:
26
snapshot_test.go
Normal file
26
snapshot_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package khepri_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/fd0/khepri"
|
||||
)
|
||||
|
||||
func TestSnapshot(t *testing.T) {
|
||||
repo, err := setupRepo()
|
||||
ok(t, err)
|
||||
|
||||
defer func() {
|
||||
err = teardownRepo(repo)
|
||||
ok(t, err)
|
||||
}()
|
||||
|
||||
sn := repo.NewSnapshot("/home/foobar")
|
||||
sn.Tree, err = khepri.ParseID("c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2")
|
||||
ok(t, err)
|
||||
sn.Time, err = time.Parse(time.RFC3339Nano, "2014-08-03T17:49:05.378595539+02:00")
|
||||
ok(t, err)
|
||||
|
||||
ok(t, sn.Save())
|
||||
}
|
Reference in New Issue
Block a user