移除预签名url相关实现
This commit is contained in:
@@ -42,30 +42,3 @@ func TestNewStorage_SkipConnectWhenNoCreds(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPresignedHelpers_WithNilClient(t *testing.T) {
|
||||
s := &StorageClient{
|
||||
client: (*minio.Client)(nil),
|
||||
buckets: map[string]string{"textures": "tex-bkt"},
|
||||
publicURL: "http://localhost:9000",
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancel()
|
||||
|
||||
// 预期会panic(nil client),用recover捕获
|
||||
func() {
|
||||
defer func() {
|
||||
if r := recover(); r == nil {
|
||||
t.Fatalf("GeneratePresignedURL expected panic with nil client")
|
||||
}
|
||||
}()
|
||||
_, _ = s.GeneratePresignedURL(ctx, "tex-bkt", "obj", time.Minute)
|
||||
}()
|
||||
func() {
|
||||
defer func() {
|
||||
if r := recover(); r == nil {
|
||||
t.Fatalf("GeneratePresignedPostURL expected panic with nil client")
|
||||
}
|
||||
}()
|
||||
_, _ = s.GeneratePresignedPostURL(ctx, "tex-bkt", "obj", 0, 10, time.Minute)
|
||||
}()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user