File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
18
18
"github.com/qiniu/go-sdk/v7/storagev2/errors"
19
19
"github.com/qiniu/go-sdk/v7/storagev2/http_client"
20
20
"github.com/qiniu/go-sdk/v7/storagev2/uptoken"
21
+ "github.com/stretchr/testify/require"
21
22
)
22
23
23
24
var (
@@ -105,3 +106,22 @@ func TestCreateBucket(t *testing.T) {
105
106
t .FailNow ()
106
107
}
107
108
}
109
+
110
+ func TestQuery (t * testing.T ) {
111
+ credentials := credentials .NewCredentials (testAK , testSK )
112
+
113
+ storage := apis .NewStorage (& http_client.Options {Credentials : credentials })
114
+
115
+ response , err := storage .QueryBucketV4 (context .Background (), & apis.QueryBucketV4Request {
116
+ Bucket : testBucket ,
117
+ AccessKey : testAK ,
118
+ }, nil )
119
+
120
+ require .NoError (t , err )
121
+
122
+ for _ , host := range response .Hosts {
123
+ require .NotNil (t , host .S3Domains )
124
+ require .NotEmpty (t , host .S3Domains .RegionAlias )
125
+ require .NotEmpty (t , host .S3Domains .PreferedApiDomains )
126
+ }
127
+ }
You can’t perform that action at this time.
0 commit comments