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

Function testGetObjectAttributes

functional_tests.go:3305–3502  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3303}
3304
3305func testGetObjectAttributes() {
3306 startTime := time.Now()
3307 testName := getFuncName()
3308 function := "GetObjectAttributes(ctx, bucketName, objectName, opts)"
3309 args := map[string]interface{}{
3310 "bucketName": "",
3311 "objectName": "",
3312 "opts": "minio.ObjectAttributesOptions{}",
3313 }
3314
3315 if !isFullMode() {
3316 logIgnored(testName, function, args, startTime, "Skipping functional tests for short/quick runs")
3317 return
3318 }
3319
3320 c, err := NewClient(ClientConfig{TrailingHeaders: true})
3321 if err != nil {
3322 logError(testName, function, args, startTime, "", "MinIO client object creation failed", err)
3323 return
3324 }
3325
3326 bucketName := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-")
3327 args["bucketName"] = bucketName
3328 err = c.MakeBucket(
3329 context.Background(),
3330 bucketName,
3331 minio.MakeBucketOptions{Region: "us-east-1"},
3332 )
3333 if err != nil {
3334 logError(testName, function, args, startTime, "", "Make bucket failed", err)
3335 return
3336 }
3337
3338 bucketNameV := randString(60, rand.NewSource(time.Now().UnixNano()), "minio-go-test-versioned-")
3339 args["bucketName"] = bucketNameV
3340 err = c.MakeBucket(
3341 context.Background(),
3342 bucketNameV,
3343 minio.MakeBucketOptions{Region: "us-east-1"},
3344 )
3345 if err != nil {
3346 logError(testName, function, args, startTime, "", "Make bucket failed", err)
3347 return
3348 }
3349 err = c.EnableVersioning(context.Background(), bucketNameV)
3350 if err != nil {
3351 logError(testName, function, args, startTime, "", "Unable to enable versioning", err)
3352 return
3353 }
3354
3355 defer cleanupBucket(bucketName, c)
3356 defer cleanupVersionedBucket(bucketNameV, c)
3357
3358 testFiles := make(map[string]*objectAttributesNewObject)
3359 testFiles["file1"] = &objectAttributesNewObject{
3360 Object: "file1",
3361 ObjectReaderType: "datafile-1.03-MB",
3362 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