aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/needle_parse_test.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-09-06 16:20:49 -0700
committerChris Lu <chris.lu@gmail.com>2021-09-06 16:20:49 -0700
commit6923af7280ed341ce90313df5e8eabaaf8e7aa47 (patch)
tree57db6d3e15db9b85a966c84a51e78c3b590163e2 /weed/operation/needle_parse_test.go
parent64f6532fbeb5e35028a19717186f712a14cbd13e (diff)
downloadseaweedfs-6923af7280ed341ce90313df5e8eabaaf8e7aa47.tar.xz
seaweedfs-6923af7280ed341ce90313df5e8eabaaf8e7aa47.zip
refactoring
Diffstat (limited to 'weed/operation/needle_parse_test.go')
-rw-r--r--weed/operation/needle_parse_test.go22
1 files changed, 20 insertions, 2 deletions
diff --git a/weed/operation/needle_parse_test.go b/weed/operation/needle_parse_test.go
index d7e8a4162..2b44b3b26 100644
--- a/weed/operation/needle_parse_test.go
+++ b/weed/operation/needle_parse_test.go
@@ -53,7 +53,16 @@ func TestCreateNeedleFromRequest(t *testing.T) {
assert.Equal(t, true, util.IsGzippedContent(n.Data), "this should be gzip")
fmt.Printf("needle: %v, originalSize: %d\n", n, originalSize)
}
- uploadResult, err, data := Upload("http://localhost:8080/389,0f084d17353afda0", "t.txt", false, bytes.NewReader([]byte(textContent)), false, "", nil, "")
+ uploadOption := &UploadOption{
+ UploadUrl: "http://localhost:8080/389,0f084d17353afda0",
+ Filename: "t.txt",
+ Cipher: false,
+ IsInputCompressed: false,
+ MimeType: "",
+ PairMap: nil,
+ Jwt: "",
+ }
+ uploadResult, err, data := Upload(bytes.NewReader([]byte(textContent)), uploadOption)
if len(data) != len(textContent) {
t.Errorf("data actual %d expected %d", len(data), len(textContent))
}
@@ -72,7 +81,16 @@ func TestCreateNeedleFromRequest(t *testing.T) {
fmt.Printf("needle: %v, dataSize:%d originalSize:%d\n", n, len(n.Data), originalSize)
}
gzippedData, _ := util.GzipData([]byte(textContent))
- Upload("http://localhost:8080/389,0f084d17353afda0", "t.txt", false, bytes.NewReader(gzippedData), true, "text/plain", nil, "")
+ uploadOption := &UploadOption{
+ UploadUrl: "http://localhost:8080/389,0f084d17353afda0",
+ Filename: "t.txt",
+ Cipher: false,
+ IsInputCompressed: true,
+ MimeType: "text/plain",
+ PairMap: nil,
+ Jwt: "",
+ }
+ Upload(bytes.NewReader(gzippedData), uploadOption)
}
/*