@@ -802,6 +802,7 @@ func (s *CosTestSuite) TestBatch() {
802802 assert .Equal (s .T (), res3 .JobId , jobid , "jobid failed" )
803803 assert .Equal (s .T (), res3 .Priority , 3 , "priority not right" )
804804
805+ // 等待状态变成Suspended
805806 for i := 0 ; i < 10 ; i = i + 1 {
806807 res , _ , err := client .Batch .DescribeJob (context .Background (), jobid , headers )
807808 assert .Nil (s .T (), err , "describe job Failed" )
@@ -830,6 +831,46 @@ func (s *CosTestSuite) TestBatch() {
830831 assert .Equal (s .T (), res4 .StatusUpdateReason , "to test" , "StatusUpdateReason failed" )
831832}
832833
834+ func (s * CosTestSuite ) TestEncryption () {
835+ opt := & cos.BucketPutEncryptionOptions {
836+ Rule : & cos.BucketEncryptionConfiguration {
837+ SSEAlgorithm : "AES256" ,
838+ },
839+ }
840+
841+ _ , err := s .Client .Bucket .PutEncryption (context .Background (), opt )
842+ assert .Nil (s .T (), err , "PutEncryption Failed" )
843+
844+ res , _ , err := s .Client .Bucket .GetEncryption (context .Background ())
845+ assert .Nil (s .T (), err , "GetEncryption Failed" )
846+ assert .Equal (s .T (), opt .Rule .SSEAlgorithm , res .Rule .SSEAlgorithm , "GetEncryption Failed" )
847+
848+ _ , err = s .Client .Bucket .DeleteEncryption (context .Background ())
849+ assert .Nil (s .T (), err , "DeleteEncryption Failed" )
850+ }
851+
852+ func (s * CosTestSuite ) TestReferer () {
853+ opt := & cos.BucketPutRefererOptions {
854+ Status : "Enabled" ,
855+ RefererType : "White-List" ,
856+ DomainList : []string {
857+ "*.qq.com" ,
858+ "*.qcloud.com" ,
859+ },
860+ EmptyReferConfiguration : "Allow" ,
861+ }
862+
863+ _ , err := s .Client .Bucket .PutReferer (context .Background (), opt )
864+ assert .Nil (s .T (), err , "PutReferer Failed" )
865+
866+ res , _ , err := s .Client .Bucket .GetReferer (context .Background ())
867+ assert .Nil (s .T (), err , "GetReferer Failed" )
868+ assert .Equal (s .T (), opt .Status , res .Status , "GetReferer Failed" )
869+ assert .Equal (s .T (), opt .RefererType , res .RefererType , "GetReferer Failed" )
870+ assert .Equal (s .T (), opt .DomainList , res .DomainList , "GetReferer Failed" )
871+ assert .Equal (s .T (), opt .EmptyReferConfiguration , res .EmptyReferConfiguration , "GetReferer Failed" )
872+ }
873+
833874// End of api test
834875
835876// All methods that begin with "Test" are run as tests within a
0 commit comments