MCPcopy Create free account
hub / github.com/DoNewsCode/core / TestManager_CreateBucket

Function TestManager_CreateBucket

ots3/uploader_test.go:36–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestManager_CreateBucket(t *testing.T) {
37 t.Parallel()
38 m := setupManager()
39 err := m.CreateBucket(context.Background(), "foo")
40 if err != nil {
41 if aerr, ok := err.(awserr.Error); ok {
42 switch aerr.Code() {
43 case s3.ErrCodeBucketAlreadyExists:
44 return
45 case s3.ErrCodeBucketAlreadyOwnedByYou:
46 return
47 default:
48 t.Fail()
49 }
50 } else {
51 t.Fail()
52 }
53 return
54 }
55}
56
57func TestManager_UploadFromUrl(t *testing.T) {
58 if os.Getenv("S3_ENDPOINT") == "" {

Callers

nothing calls this directly

Calls 3

setupManagerFunction · 0.85
CreateBucketMethod · 0.80
FailMethod · 0.80

Tested by

no test coverage detected