S3: Add RequestTimeout in unittest.

This commit is contained in:
Zhang Huangbin
2023-09-05 17:34:55 +08:00
parent ae41d2f5c1
commit e735c69371
4 changed files with 9 additions and 5 deletions

View File

@@ -74,7 +74,7 @@ err := store.Set("my-key", []byte("my-value"))
Or, call `SetWithChecksum()` to create an object with checksum to
ask S3 server to verify data integrity on server side:
> Currently 4 algorithm are supported:
> Currently 4 algorithms are supported:
> - types.ChecksumAlgorithmCrc32 (`CRC32`)
> - types.ChecksumAlgorithmCrc32c (`CRC32C`)
> - types.ChecksumAlgorithmSha1 (`SHA1`)

View File

@@ -1,5 +1,9 @@
package s3
import (
"time"
)
var testStore *Storage
func init() {
@@ -12,7 +16,7 @@ func init() {
AccessKey: "minioadmin",
SecretAccessKey: "minioadmin",
},
RequestTimeout: 10 * time.Second,
},
)
}

View File

@@ -12,8 +12,8 @@ import (
// Additional methods for S3, but not required by gofiber Storage interface.
// SetWithChecksum sets key with value and checksum.
// Key of `checksum` map is algorithm in upper cases, value is the checksum.
// Currently only 4 algorithm are supported:
//
// Currently 4 algorithms are supported:
// - types.ChecksumAlgorithmCrc32 (`CRC32`)
// - types.ChecksumAlgorithmCrc32c (`CRC32C`)
// - types.ChecksumAlgorithmSha1 (`SHA1`)

View File

@@ -10,7 +10,7 @@ import (
func Test_S3_SetWithChecksum(t *testing.T) {
var (
key = "john"
key = "set-with-checksum"
val = []byte("doe")
sha256sum = sha256.New().Sum(val)
checksum = map[types.ChecksumAlgorithm][]byte{