diff --git a/oss/client_test.go b/oss/client_test.go index 6ccf4dc..e4b3640 100644 --- a/oss/client_test.go +++ b/oss/client_test.go @@ -3820,10 +3820,18 @@ func (s *OssClientSuite) TestSetBucketInventory(c *C) { err = client.CreateBucket(bucketName) c.Assert(err, IsNil) + bucket, err := client.Bucket(bucketName) + c.Assert(err, IsNil) + err = bucket.PutObject("key", strings.NewReader(""), ServerSideEncryption("AES256")) + + pros, err := bucket.GetObjectDetailedMeta("key") + + bucket.DeleteObject("key") + // encryption config var invSseOss InvSseOss invSseKms := InvSseKms{ - KmsId: kmsID, + KmsId: pros.Get("x-oss-server-side-encryption-key-id"), } var invEncryption InvEncryption @@ -5865,4 +5873,5 @@ func (s *OssClientSuite) TestBucketResponseHeader(c *C) { c.Assert(rule.Rule[0].Filters.Operation[1], Equals, "GetObject") err = client.DeleteBucketResponseHeader(bucketName) c.Assert(err, IsNil) + client.DeleteBucket(bucketName) } diff --git a/oss/type_test.go b/oss/type_test.go index d34a7c7..f66de97 100644 --- a/oss/type_test.go +++ b/oss/type_test.go @@ -2,11 +2,12 @@ package oss import ( "encoding/xml" - . "gopkg.in/check.v1" "log" "net/url" "sort" "strings" + + . "gopkg.in/check.v1" ) type OssTypeSuite struct{} @@ -1934,7 +1935,7 @@ func (s *OssTypeSuite) TestPutResponseHeader(c *C) { } xmlData, err = xml.Marshal(reqHeader) c.Assert(err, IsNil) - c.Assert(string(xmlData), Equals, "name1PutGetObject
Last-Modified
name2*
Last-Modified
") + c.Assert(string(xmlData), Equals, "name1") } func (s *OssTypeSuite) TestGetResponseHeaderResult(c *C) { @@ -2036,4 +2037,4 @@ func (s *OssTypeSuite) TestPutBucketCORS(c *C) { bs, err := xml.Marshal(put) c.Assert(err, IsNil) c.Assert(string(bs), Equals, "*PUTGETPOST100http://www.a.comhttp://www.b.comGETAuthorizationx-oss-testx-oss-test1100true") -} \ No newline at end of file +}