Use package "restic/test"

This commit is contained in:
Alexander Neumann 2015-04-09 21:15:48 +02:00
parent a2514425a3
commit 4f4f3c421a
24 changed files with 248 additions and 403 deletions

View file

@ -7,16 +7,17 @@ import (
"testing"
"github.com/restic/restic/backend/sftp"
. "github.com/restic/restic/test"
)
var sftpPath = flag.String("test.sftppath", "", "sftp binary path (default: empty)")
func setupSFTPBackend(t *testing.T) *sftp.SFTP {
tempdir, err := ioutil.TempDir("", "restic-test-")
ok(t, err)
OK(t, err)
b, err := sftp.Create(tempdir, *sftpPath)
ok(t, err)
OK(t, err)
t.Logf("created sftp backend locally at %s", tempdir)
@ -30,7 +31,7 @@ func teardownSFTPBackend(t *testing.T, b *sftp.SFTP) {
}
err := os.RemoveAll(b.Location())
ok(t, err)
OK(t, err)
}
func TestSFTPBackend(t *testing.T) {