controllers: cleanup TestStorageCopyFromPath files

Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
Hidde Beydals 2022-01-28 11:32:22 +01:00
parent 21a7dfeb1e
commit 028a85d61a
1 changed files with 1 additions and 5 deletions

View File

@ -317,15 +317,11 @@ func TestStorageCopyFromPath(t *testing.T) {
}
createFile := func(file *File) (absPath string, err error) {
defer func() {
if err != nil && dir != "" {
os.RemoveAll(dir)
}
}()
dir, err = os.MkdirTemp("", "test-files-")
if err != nil {
return
}
t.Cleanup(cleanupStoragePath(dir))
absPath = filepath.Join(dir, file.Name)
if err = os.MkdirAll(filepath.Dir(absPath), 0755); err != nil {
return