Use package "restic/test"
This commit is contained in:
parent
a2514425a3
commit
4f4f3c421a
24 changed files with 248 additions and 403 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue