mirror of https://github.com/portainer/portainer
23 lines
368 B
Go
23 lines
368 B
Go
|
package filesystem
|
||
|
|
||
|
import (
|
||
|
"os"
|
||
|
"path"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func createService(t *testing.T) *Service {
|
||
|
dataStorePath := path.Join(os.TempDir(), t.Name())
|
||
|
|
||
|
service, err := NewService(dataStorePath, "")
|
||
|
assert.NoError(t, err, "NewService should not fail")
|
||
|
|
||
|
t.Cleanup(func() {
|
||
|
os.RemoveAll(dataStorePath)
|
||
|
})
|
||
|
|
||
|
return service
|
||
|
}
|