Skip to content

Commit

Permalink
update ci ImageProcessResult, update ut
Browse files Browse the repository at this point in the history
  • Loading branch information
jojoliang committed Mar 2, 2022
1 parent cb64742 commit 55f2349
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 35 deletions.
8 changes: 4 additions & 4 deletions bucket_inventory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestBucketService_PutInventory(t *testing.T) {
ID: "list1",
IsEnabled: "True",
IncludedObjectVersions: "All",
Filter: &BucketInventoryFilter{"myPrefix"},
Filter: &BucketInventoryFilter{"myPrefix", nil},
Schedule: &BucketInventorySchedule{"Daily"},
Destination: &BucketInventoryDestination{
Bucket: "qcs::cos:ap-guangzhou::examplebucket-1250000000",
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestBucketService_GetInventory(t *testing.T) {
ID: "list1",
IsEnabled: "True",
IncludedObjectVersions: "All",
Filter: &BucketInventoryFilter{"myPrefix"},
Filter: &BucketInventoryFilter{"myPrefix", nil},
Schedule: &BucketInventorySchedule{"Daily"},
Destination: &BucketInventoryDestination{
Bucket: "qcs::cos:ap-guangzhou::examplebucket-1250000000",
Expand Down Expand Up @@ -221,7 +221,7 @@ func TestBucketService_ListInventory(t *testing.T) {
ID: "list1",
IsEnabled: "True",
IncludedObjectVersions: "All",
Filter: &BucketInventoryFilter{"myPrefix"},
Filter: &BucketInventoryFilter{"myPrefix", nil},
Schedule: &BucketInventorySchedule{"Daily"},
Destination: &BucketInventoryDestination{
Bucket: "qcs::cos:ap-beijing::examplebucket-1250000000",
Expand All @@ -246,7 +246,7 @@ func TestBucketService_ListInventory(t *testing.T) {
ID: "list2",
IsEnabled: "True",
IncludedObjectVersions: "All",
Filter: &BucketInventoryFilter{"myPrefix2"},
Filter: &BucketInventoryFilter{"myPrefix2", nil},
Schedule: &BucketInventorySchedule{"Weekly"},
Destination: &BucketInventoryDestination{
Bucket: "qcs::cos:ap-beijing::examplebucket-1250000000",
Expand Down
6 changes: 3 additions & 3 deletions ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ func EncodePicOperations(pic *PicOperations) string {
}

type ImageProcessResult struct {
XMLName xml.Name `xml:"UploadResult"`
OriginalInfo *PicOriginalInfo `xml:"OriginalInfo,omitempty"`
ProcessResults *PicProcessObject `xml:"ProcessResults>Object,omitempty"`
XMLName xml.Name `xml:"UploadResult"`
OriginalInfo *PicOriginalInfo `xml:"OriginalInfo,omitempty"`
ProcessResults []PicProcessObject `xml:"ProcessResults>Object,omitempty"`
}
type PicOriginalInfo struct {
Key string `xml:"Key,omitempty"`
Expand Down
62 changes: 34 additions & 28 deletions ci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,17 @@ func TestCIService_ImageProcess(t *testing.T) {
Orientation: 0,
},
},
ProcessResults: &PicProcessObject{
Key: "format.jpg",
Location: "example-1250000000.cos.ap-guangzhou.myqcloud.com/format.jpg",
Format: "PNG",
Width: 103,
Height: 99,
Size: 21351,
Quality: 100,
ETag: "\"8894dbe5e3ebfaf761e39b9d619c28f3327b8d85\"",
ProcessResults: []PicProcessObject{
{
Key: "format.jpg",
Location: "example-1250000000.cos.ap-guangzhou.myqcloud.com/format.jpg",
Format: "PNG",
Width: 103,
Height: 99,
Size: 21351,
Quality: 100,
ETag: "\"8894dbe5e3ebfaf761e39b9d619c28f3327b8d85\"",
},
},
}

Expand Down Expand Up @@ -471,7 +473,7 @@ func TestCIService_PutWebpageAuditingJob(t *testing.T) {
})

opt := &PutWebpageAuditingJobOptions{
InputUrl: "http://www.example.com",
InputUrl: "http://www.example.com",
Conf: &WebpageAuditingJobConf{
DetectType: "Porn,Terrorism,Politics,Ads",
Callback: "http://www.example.com/",
Expand Down Expand Up @@ -583,15 +585,17 @@ func TestCIService_Put(t *testing.T) {
Orientation: 0,
},
},
ProcessResults: &PicProcessObject{
Key: "format.jpg",
Location: "example-1250000000.cos.ap-guangzhou.myqcloud.com/format.jpg",
Format: "PNG",
Width: 103,
Height: 99,
Size: 21351,
Quality: 100,
ETag: "\"8894dbe5e3ebfaf761e39b9d619c28f3327b8d85\"",
ProcessResults: []PicProcessObject{
{
Key: "format.jpg",
Location: "example-1250000000.cos.ap-guangzhou.myqcloud.com/format.jpg",
Format: "PNG",
Width: 103,
Height: 99,
Size: 21351,
Quality: 100,
ETag: "\"8894dbe5e3ebfaf761e39b9d619c28f3327b8d85\"",
},
},
}

Expand Down Expand Up @@ -704,15 +708,17 @@ func TestCIService_PutFromFile(t *testing.T) {
Orientation: 0,
},
},
ProcessResults: &PicProcessObject{
Key: "format.jpg",
Location: "example-1250000000.cos.ap-guangzhou.myqcloud.com/format.jpg",
Format: "PNG",
Width: 103,
Height: 99,
Size: 21351,
Quality: 100,
ETag: "\"8894dbe5e3ebfaf761e39b9d619c28f3327b8d85\"",
ProcessResults: []PicProcessObject{
{
Key: "format.jpg",
Location: "example-1250000000.cos.ap-guangzhou.myqcloud.com/format.jpg",
Format: "PNG",
Width: 103,
Height: 99,
Size: 21351,
Quality: 100,
ETag: "\"8894dbe5e3ebfaf761e39b9d619c28f3327b8d85\"",
},
},
}

Expand Down

0 comments on commit 55f2349

Please sign in to comment.