mirror of
https://github.com/portainer/portainer.git
synced 2026-06-23 06:20:12 +00:00
23 lines
394 B
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
|
|
}
|