Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion server/s3/multipart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package s3
import (
"bytes"
"context"
"encoding/json"
"errors"
"os"
"path/filepath"
Expand Down Expand Up @@ -67,11 +68,21 @@ func setupMultipartBackend(t *testing.T) (*s3Backend, string) {
t.Fatalf("mkdir local root: %v", err)
}
t.Cleanup(func() { _ = os.RemoveAll(localRoot) })
addition, err := json.Marshal(struct {
RootFolderPath string `json:"root_folder_path"`
Thumbnail bool `json:"thumbnail"`
}{
RootFolderPath: localRoot,
Thumbnail: false,
})
if err != nil {
t.Fatalf("marshal local storage addition: %v", err)
}

_, err = op.CreateStorage(ctx, model.Storage{
Driver: "Local",
MountPath: mount,
Addition: `{"root_folder_path":"` + localRoot + `","thumbnail":false}`,
Addition: string(addition),
})
if err != nil {
t.Fatalf("create local storage: %+v", err)
Expand Down