Files
portainer/api/filesystem/filesystem_test.go

23 lines
394 B
Go

package filesystem
import (
"os"
"testing"
"github.com/stretchr/testify/require"
)
func createService(t *testing.T) *Service {
dataStorePath := JoinPaths(t.TempDir(), t.Name())
service, err := NewService(dataStorePath, "")
require.NoError(t, err, "NewService should not fail")
t.Cleanup(func() {
err := os.RemoveAll(dataStorePath)
require.NoError(t, err)
})
return service
}