Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

s3: actually compress the payload for content-type gzip test

Nick Craig-Wood06182a344340
diff --git a/backend/s3/s3_internal_test.go b/backend/s3/s3_internal_test.go
index ecd39f41f..2568968d6 100644
--- a/backend/s3/s3_internal_test.go
+++ b/backend/s3/s3_internal_test.go
@@ -1,6 +1,8 @@
package s3
import (
+ "bytes"
+ "compress/gzip"
"context"
"fmt"
"testing"
@@ -14,9 +16,20 @@ import (
"github.com/stretchr/testify/require"
)
+func gz(t *testing.T, s string) string {
+ var buf bytes.Buffer
+ zw := gzip.NewWriter(&buf)
+ _, err := zw.Write([]byte(s))
+ require.NoError(t, err)
+ err = zw.Close()
+ require.NoError(t, err)
+ return buf.String()
+}
+
func (f *Fs) InternalTestMetadata(t *testing.T) {
ctx := context.Background()
- contents := random.String(100)
+ contents := gz(t, random.String(1000))
+
item := fstest.NewItem("test-metadata", contents, fstest.Time("2001-05-06T04:05:06.499999999Z"))
btime := time.Now()
metadata := fs.Metadata{