Skip to content

Commit 6bc7b52

Browse files
authored
Merge pull request #89 from agin719/common-dev
fix ci_test
2 parents 95b1272 + d18e8cf commit 6bc7b52

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

costesting/ci_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const (
5656
kBucket = "cosgosdktest-1259654469"
5757
kRegion = "ap-guangzhou"
5858

59-
// 跨区域复制需要的目标存储桶,地域不能与kBucket存储桶相同
59+
// 跨区域复制需要的目标存储桶,地域不能与kBucket存储桶相同, 目的存储桶需要开启多版本
6060
kRepBucket = "cosgosdkreptest"
6161
kRepRegion = "ap-chengdu"
6262

@@ -85,9 +85,9 @@ func (s *CosTestSuite) SetupSuite() {
8585
s.Region = p[2]
8686

8787
// Bucket name
88-
pp := strings.Split(p[0], "-")
89-
s.Bucket = pp[0]
90-
s.Appid = pp[1]
88+
pi := strings.LastIndex(p[0], "-")
89+
s.Bucket = p[0][:pi]
90+
s.Appid = p[0][pi+1:]
9191

9292
ib := &cos.BaseURL{BucketURL: bucketurl, BatchURL: batchurl}
9393
s.Client = cos.NewClient(ib, &http.Client{
@@ -185,12 +185,12 @@ func (s *CosTestSuite) TestGetBucket() {
185185
}
186186

187187
func (s *CosTestSuite) TestGetObjectVersions() {
188-
opt := &cos.BucketGetObjectVersionsOptions {
188+
opt := &cos.BucketGetObjectVersionsOptions{
189189
Prefix: "中文",
190190
MaxKeys: 3,
191191
}
192-
_, _, err := s.Client.Bucket.GetObjectVersions(context.Background(), opt)
193-
assert.Nil(s.T(), err, "GetObjectVersions Failed")
192+
_, _, err := s.Client.Bucket.GetObjectVersions(context.Background(), opt)
193+
assert.Nil(s.T(), err, "GetObjectVersions Failed")
194194
}
195195

196196
func (s *CosTestSuite) TestGetBucketLocation() {

0 commit comments

Comments
 (0)