MCPcopy
hub / github.com/minio/minio-go / testGetObjectAttributes

Function testGetObjectAttributes

functional_tests.go:3201–3398  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3199}
3200
3201func testGetObjectAttributes() {
3202 startTime := time.Now()
3203 testName := getFuncName()
3204 function := "GetObjectAttributes(ctx, bucketName, objectName, opts)"
3205 args := map[string]interface{}{
3206 "bucketName": "",
3207 "objectName": "",
3208 "opts": "minio.ObjectAttributesOptions{}",
3209 }
3210
3211 if !isFullMode() {
3212 logIgnored(testName, function, args, startTime, "Skipping functional tests for short/quick runs")
3213 return
3214 }
3215
3216 c, err := NewClient(ClientConfig{TrailingHeaders: true})
3217 if err != nil {
3218 logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
3219 return
3220 }
3221
3222 bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
3223 args["bucketName"] = bucketName
3224 err = c.MakeBucket(
3225 context.Background(),
3226 bucketName,
3227 minio.MakeBucketOptions{Region: "us-east-1"},
3228 )
3229 if err != nil {
3230 logError(testName, function, args, startTime, "", "Make bucket failed", err)
3231 return
3232 }
3233
3234 bucketNameV := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-versioned-")
3235 args["bucketName"] = bucketNameV
3236 err = c.MakeBucket(
3237 context.Background(),
3238 bucketNameV,
3239 minio.MakeBucketOptions{Region: "us-east-1"},
3240 )
3241 if err != nil {
3242 logError(testName, function, args, startTime, "", "Make bucket failed", err)
3243 return
3244 }
3245 err = c.EnableVersioning(context.Background(), bucketNameV)
3246 if err != nil {
3247 logError(testName, function, args, startTime, "", "Unable to enable versioning", err)
3248 return
3249 }
3250
3251 defer cleanupBucket(bucketName, c)
3252 defer cleanupVersionedBucket(bucketNameV, c)
3253
3254 testFiles := make(map[string]*objectAttributesNewObject)
3255 testFiles["file1"] = &objectAttributesNewObject{
3256 Object: "file1",
3257 ObjectReaderType: "datafile-1.03-MB",
3258 Bucket: bucketNameV,

Callers 1

mainFunction · 0.85

Calls 15

MakeBucketMethod · 0.95
EnableVersioningMethod · 0.95
PutObjectMethod · 0.95
GetObjectAttributesMethod · 0.95
getFuncNameFunction · 0.85
isFullModeFunction · 0.85
logIgnoredFunction · 0.85
NewClientFunction · 0.85
logErrorFunction · 0.85
cleanupBucketFunction · 0.85
cleanupVersionedBucketFunction · 0.85
getDataReaderFunction · 0.85

Tested by

no test coverage detected