MCPcopy
hub / github.com/sa7mon/S3Scanner / TestBucket_String

Function TestBucket_String

bucket/bucket_test.go:332–390  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

330}
331
332func TestBucket_String(t *testing.T) {
333 t.Parallel()
334
335 var tests = []struct {
336 name string
337 bucket Bucket
338 string string
339 }{
340 {name: "public read", bucket: Bucket{
341 Exists: BucketExists,
342 PermAllUsersRead: PermissionAllowed,
343 }, string: "AuthUsers: [] | AllUsers: [READ]"},
344 {name: "public read-write", bucket: Bucket{
345 Exists: BucketExists,
346 PermAllUsersRead: PermissionAllowed,
347 PermAllUsersWrite: PermissionAllowed,
348 }, string: "AuthUsers: [] | AllUsers: [READ, WRITE]"},
349 {name: "public read acl", bucket: Bucket{
350 Exists: BucketExists,
351 PermAllUsersReadACL: PermissionAllowed,
352 }, string: "AuthUsers: [] | AllUsers: [READ_ACP]"},
353 {name: "public write acl", bucket: Bucket{
354 Exists: BucketExists,
355 PermAllUsersWriteACL: PermissionAllowed,
356 }, string: "AuthUsers: [] | AllUsers: [WRITE_ACP]"},
357 {name: "public full control", bucket: Bucket{
358 Exists: BucketExists,
359 PermAllUsersFullControl: PermissionAllowed,
360 }, string: "AuthUsers: [] | AllUsers: [FULL_CONTROL]"},
361 {name: "auth read", bucket: Bucket{
362 Exists: BucketExists,
363 PermAuthUsersRead: PermissionAllowed,
364 }, string: "AuthUsers: [READ] | AllUsers: []"},
365 {name: "auth read-write", bucket: Bucket{
366 Exists: BucketExists,
367 PermAuthUsersRead: PermissionAllowed,
368 PermAuthUsersWrite: PermissionAllowed,
369 }, string: "AuthUsers: [READ, WRITE] | AllUsers: []"},
370 {name: "auth read acl", bucket: Bucket{
371 Exists: BucketExists,
372 PermAuthUsersReadACL: PermissionAllowed,
373 }, string: "AuthUsers: [READ_ACP] | AllUsers: []"},
374 {name: "auth write acl", bucket: Bucket{
375 Exists: BucketExists,
376 PermAuthUsersWriteACL: PermissionAllowed,
377 }, string: "AuthUsers: [WRITE_ACP] | AllUsers: []"},
378 {name: "auth full control", bucket: Bucket{
379 Exists: BucketExists,
380 PermAuthUsersFullControl: PermissionAllowed,
381 }, string: "AuthUsers: [FULL_CONTROL] | AllUsers: []"},
382 }
383
384 for _, tt := range tests {
385 t.Run(tt.name, func(t2 *testing.T) {
386 t2.Parallel()
387 assert.Equal(t2, tt.string, tt.bucket.String())
388 })
389 }

Callers

nothing calls this directly

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected