mirror of
https://github.com/restic/restic.git
synced 2025-08-12 14:47:41 +00:00
Remove all dot-imports
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
|
||||
"github.com/restic/restic/internal/backend/sftp"
|
||||
"github.com/restic/restic/internal/restic"
|
||||
. "github.com/restic/restic/internal/test"
|
||||
rtest "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func TestLayout(t *testing.T) {
|
||||
@@ -16,7 +16,7 @@ func TestLayout(t *testing.T) {
|
||||
t.Skip("sftp server binary not available")
|
||||
}
|
||||
|
||||
path, cleanup := TempDir(t)
|
||||
path, cleanup := rtest.TempDir(t)
|
||||
defer cleanup()
|
||||
|
||||
var tests = []struct {
|
||||
@@ -39,7 +39,7 @@ func TestLayout(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Run(test.filename, func(t *testing.T) {
|
||||
SetupTarTestFixture(t, path, filepath.Join("..", "testdata", test.filename))
|
||||
rtest.SetupTarTestFixture(t, path, filepath.Join("..", "testdata", test.filename))
|
||||
|
||||
repo := filepath.Join(path, "repo")
|
||||
be, err := sftp.Open(sftp.Config{
|
||||
@@ -82,7 +82,7 @@ func TestLayout(t *testing.T) {
|
||||
t.Errorf("Close() returned error %v", err)
|
||||
}
|
||||
|
||||
RemoveAll(t, filepath.Join(path, "repo"))
|
||||
rtest.RemoveAll(t, filepath.Join(path, "repo"))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@@ -12,12 +12,11 @@ import (
|
||||
"github.com/restic/restic/internal/backend/test"
|
||||
"github.com/restic/restic/internal/errors"
|
||||
"github.com/restic/restic/internal/restic"
|
||||
|
||||
. "github.com/restic/restic/internal/test"
|
||||
rtest "github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
func findSFTPServerBinary() string {
|
||||
for _, dir := range strings.Split(TestSFTPPath, ":") {
|
||||
for _, dir := range strings.Split(rtest.TestSFTPPath, ":") {
|
||||
testpath := filepath.Join(dir, "sftp-server")
|
||||
_, err := os.Stat(testpath)
|
||||
if !os.IsNotExist(errors.Cause(err)) {
|
||||
@@ -34,7 +33,7 @@ func newTestSuite(t testing.TB) *test.Suite {
|
||||
return &test.Suite{
|
||||
// NewConfig returns a config for a new temporary backend that will be used in tests.
|
||||
NewConfig: func() (interface{}, error) {
|
||||
dir, err := ioutil.TempDir(TestTempDir, "restic-test-sftp-")
|
||||
dir, err := ioutil.TempDir(rtest.TestTempDir, "restic-test-sftp-")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -63,11 +62,11 @@ func newTestSuite(t testing.TB) *test.Suite {
|
||||
// CleanupFn removes data created during the tests.
|
||||
Cleanup: func(config interface{}) error {
|
||||
cfg := config.(sftp.Config)
|
||||
if !TestCleanupTempDirs {
|
||||
if !rtest.TestCleanupTempDirs {
|
||||
t.Logf("leaving test backend dir at %v", cfg.Path)
|
||||
}
|
||||
|
||||
RemoveAll(t, cfg.Path)
|
||||
rtest.RemoveAll(t, cfg.Path)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
@@ -76,7 +75,7 @@ func newTestSuite(t testing.TB) *test.Suite {
|
||||
func TestBackendSFTP(t *testing.T) {
|
||||
defer func() {
|
||||
if t.Skipped() {
|
||||
SkipDisallowed(t, "restic/backend/sftp.TestBackendSFTP")
|
||||
rtest.SkipDisallowed(t, "restic/backend/sftp.TestBackendSFTP")
|
||||
}
|
||||
}()
|
||||
|
||||
|
Reference in New Issue
Block a user